1
package org.hibernate.test.hql;
4
* @author Steve Ebersole
6
public class SimpleAssociatedEntity {
9
private SimpleEntityWithAssociation owner;
11
public SimpleAssociatedEntity() {
14
public SimpleAssociatedEntity(String name) {
18
public SimpleAssociatedEntity(String name, SimpleEntityWithAssociation owner) {
27
public void setId(Long id) {
31
public String getName() {
35
public void setName(String name) {
39
public SimpleEntityWithAssociation getOwner() {
43
public void setOwner(SimpleEntityWithAssociation owner) {
47
public void bindToOwner(SimpleEntityWithAssociation owner) {
48
if ( owner != this.owner ) {
49
unbindFromCurrentOwner();
50
if ( owner != null ) {
51
owner.getAssociatedEntities().add( this );
57
public void unbindFromCurrentOwner() {
58
if ( this.owner != null ) {
59
this.owner.getAssociatedEntities().remove( this );