FileDocCategorySizeDatePackage
SimpleAssociatedEntity.javaAPI DocHibernate 3.2.51159Fri Jan 13 09:09:26 GMT 2006org.hibernate.test.hql

SimpleAssociatedEntity

public class SimpleAssociatedEntity extends Object
author
Steve Ebersole

Fields Summary
private Long
id
private String
name
private SimpleEntityWithAssociation
owner
Constructors Summary
public SimpleAssociatedEntity()

	
public SimpleAssociatedEntity(String name)

		this.name = name;
	
public SimpleAssociatedEntity(String name, SimpleEntityWithAssociation owner)

		this( name );
		bindToOwner( owner );
	
Methods Summary
public voidbindToOwner(SimpleEntityWithAssociation owner)

		if ( owner != this.owner ) {
			unbindFromCurrentOwner();
			if ( owner != null ) {
				owner.getAssociatedEntities().add( this );
			}
		}
		this.owner = owner;
	
public java.lang.LonggetId()

		return id;
	
public java.lang.StringgetName()

		return name;
	
public SimpleEntityWithAssociationgetOwner()

		return owner;
	
public voidsetId(java.lang.Long id)

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

		this.name = name;
	
public voidsetOwner(SimpleEntityWithAssociation owner)

		this.owner = owner;
	
public voidunbindFromCurrentOwner()

		if ( this.owner != null ) {
			this.owner.getAssociatedEntities().remove( this );
			this.owner = null;
		}