1 56 package org.objectstyle.cayenne.map.event; 57 58 import org.objectstyle.cayenne.map.Entity; 59 import org.objectstyle.cayenne.map.Relationship; 60 61 70 public class RelationshipEvent extends EntityEvent { 71 protected Relationship relationship; 72 73 74 public RelationshipEvent(Object src, Relationship rel, Entity entity) { 75 super(src, entity); 76 setRelationship(rel); 77 } 78 79 80 public RelationshipEvent( 81 Object src, 82 Relationship rel, 83 Entity entity, 84 int id) { 85 86 this(src, rel, entity); 87 setId(id); 88 } 89 90 91 public RelationshipEvent( 92 Object src, 93 Relationship rel, 94 Entity entity, 95 String oldName) { 96 97 this(src, rel, entity); 98 setOldName(oldName); 99 } 100 101 102 public Relationship getRelationship() { 103 return relationship; 104 } 105 106 111 public void setRelationship(Relationship relationship) { 112 this.relationship = relationship; 113 } 114 115 public String getNewName() { 116 return (relationship != null) ? relationship.getName() : null; 117 } 118 } | Popular Tags |