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

OneToMany

public class OneToMany extends Object implements Value
A mapping for a one-to-many association
author
Gavin King

Fields Summary
private String
referencedEntityName
private Table
referencingTable
private PersistentClass
associatedClass
private boolean
embedded
private boolean
ignoreNotFound
Constructors Summary
public OneToMany(PersistentClass owner)

		this.referencingTable = (owner==null) ? null : owner.getTable();
	
Methods Summary
public java.lang.Objectaccept(ValueVisitor visitor)

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

		// no foreign key element of for a one-to-many
	
public PersistentClassgetAssociatedClass()

		return associatedClass;
	
public boolean[]getColumnInsertability()

		//TODO: we could just return all false...
		throw new UnsupportedOperationException();
	
public java.util.IteratorgetColumnIterator()

		return associatedClass.getKey().getColumnIterator();
	
public intgetColumnSpan()

		return associatedClass.getKey().getColumnSpan();
	
public boolean[]getColumnUpdateability()

		//TODO: we could just return all false...
		throw new UnsupportedOperationException();
	
private org.hibernate.type.EntityTypegetEntityType()

		return TypeFactory.manyToOne(
				getReferencedEntityName(), 
				null, 
				false,
				false,
				isEmbedded(),
				isIgnoreNotFound()
			);
	
public org.hibernate.FetchModegetFetchMode()

		return FetchMode.JOIN;
	
public java.lang.StringgetReferencedEntityName()

		return referencedEntityName;
	
public TablegetTable()
Table of the owner entity (the "one" side)

		return referencingTable;
	
public org.hibernate.type.TypegetType()

		return getEntityType();
	
public booleanhasFormula()

		return false;
	
public booleanisAlternateUniqueKey()

		return false;
	
public booleanisEmbedded()

		return embedded;
	
public booleanisIgnoreNotFound()

		return ignoreNotFound;
	
public booleanisNullable()

		return false;
	
public booleanisSimpleValue()

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

		if (referencedEntityName==null) {
			throw new MappingException("one to many association must specify the referenced entity");
		}
		return true;
	
public voidsetAssociatedClass(PersistentClass associatedClass)
Associated entity on the many side

		this.associatedClass = associatedClass;
	
public voidsetEmbedded(boolean embedded)

		this.embedded = embedded;
	
public voidsetIgnoreNotFound(boolean ignoreNotFound)

		this.ignoreNotFound = ignoreNotFound;
	
public voidsetReferencedEntityName(java.lang.String referencedEntityName)
Associated entity on the "many" side

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