FileDocCategorySizeDatePackage
ToOne.javaAPI DocHibernate 3.2.52442Mon Jun 20 15:32:36 BST 2005org.hibernate.mapping

ToOne

public abstract class ToOne extends SimpleValue implements Fetchable
A simple-point association (ie. a reference to another entity).
author
Gavin King

Fields Summary
private org.hibernate.FetchMode
fetchMode
protected String
referencedPropertyName
private String
referencedEntityName
private boolean
embedded
private boolean
lazy
protected boolean
unwrapProxy
Constructors Summary
protected ToOne(Table table)


	   
		super(table);
	
Methods Summary
public java.lang.Objectaccept(ValueVisitor visitor)

		return visitor.accept(this);
	
public abstract voidcreateForeignKey()

public org.hibernate.FetchModegetFetchMode()

		return fetchMode;
	
public java.lang.StringgetReferencedEntityName()

		return referencedEntityName;
	
public java.lang.StringgetReferencedPropertyName()

		return referencedPropertyName;
	
public abstract org.hibernate.type.TypegetType()

public booleanisEmbedded()

		return embedded;
	
public booleanisLazy()

		return lazy;
	
public booleanisTypeSpecified()

		return referencedEntityName!=null;
	
public booleanisUnwrapProxy()

		return unwrapProxy;
	
public booleanisValid(org.hibernate.engine.Mapping mapping)

		if (referencedEntityName==null) {
			throw new MappingException("association must specify the referenced entity");
		}
		return super.isValid( mapping );
	
public voidsetEmbedded(boolean embedded)

		this.embedded = embedded;
	
public voidsetFetchMode(org.hibernate.FetchMode fetchMode)

		this.fetchMode=fetchMode;
	
public voidsetLazy(boolean lazy)

		this.lazy = lazy;
	
public voidsetReferencedEntityName(java.lang.String referencedEntityName)

		this.referencedEntityName = referencedEntityName==null ? 
				null : referencedEntityName.intern();
	
public voidsetReferencedPropertyName(java.lang.String name)

		referencedPropertyName = name==null ? null : name.intern();
	
public voidsetTypeUsingReflection(java.lang.String className, java.lang.String propertyName)

		if (referencedEntityName==null) {
			referencedEntityName = ReflectHelper.reflectedPropertyClass(className, propertyName).getName();
		}
	
public voidsetUnwrapProxy(boolean unwrapProxy)

		this.unwrapProxy = unwrapProxy;