FileDocCategorySizeDatePackage
SimpleEntityWithAssociation.javaAPI DocHibernate 3.2.51595Mon Feb 13 08:50:52 GMT 2006org.hibernate.test.hql

SimpleEntityWithAssociation

public class SimpleEntityWithAssociation extends Object
author
Steve Ebersole

Fields Summary
private Long
id
private String
name
private Set
associatedEntities
private Set
manyToManyAssociatedEntities
Constructors Summary
public SimpleEntityWithAssociation()


	  
	
public SimpleEntityWithAssociation(String name)

		this.name = name;
	
Methods Summary
public voidaddAssociation(SimpleAssociatedEntity association)

		association.bindToOwner( this );
	
public SimpleAssociatedEntityaddAssociation(java.lang.String name)

		return new SimpleAssociatedEntity( name, this );
	
public java.util.SetgetAssociatedEntities()

		return associatedEntities;
	
public java.lang.LonggetId()

		return id;
	
public java.util.SetgetManyToManyAssociatedEntities()

		return manyToManyAssociatedEntities;
	
public java.lang.StringgetName()

		return name;
	
public voidremoveAssociation(SimpleAssociatedEntity association)

		if ( getAssociatedEntities().contains( association ) ) {
			association.unbindFromCurrentOwner();
		}
		else {
			throw new IllegalArgumentException( "SimpleAssociatedEntity [" + association + "] not currently bound to this [" + this + "]" );
		}
	
public voidsetAssociatedEntities(java.util.Set associatedEntities)

		this.associatedEntities = associatedEntities;
	
public voidsetId(java.lang.Long id)

		this.id = id;
	
public voidsetManyToManyAssociatedEntities(java.util.Set manyToManyAssociatedEntities)

		this.manyToManyAssociatedEntities = manyToManyAssociatedEntities;
	
public voidsetName(java.lang.String name)

		this.name = name;