1 19 20 package org.apache.cayenne.map.event; 21 22 import org.apache.cayenne.map.Entity; 23 import org.apache.cayenne.map.Relationship; 24 25 34 public class RelationshipEvent extends EntityEvent { 35 protected Relationship relationship; 36 37 38 public RelationshipEvent(Object src, Relationship rel, Entity entity) { 39 super(src, entity); 40 setRelationship(rel); 41 } 42 43 44 public RelationshipEvent( 45 Object src, 46 Relationship rel, 47 Entity entity, 48 int id) { 49 50 this(src, rel, entity); 51 setId(id); 52 } 53 54 55 public RelationshipEvent( 56 Object src, 57 Relationship rel, 58 Entity entity, 59 String oldName) { 60 61 this(src, rel, entity); 62 setOldName(oldName); 63 } 64 65 66 public Relationship getRelationship() { 67 return relationship; 68 } 69 70 75 public void setRelationship(Relationship relationship) { 76 this.relationship = relationship; 77 } 78 79 public String getNewName() { 80 return (relationship != null) ? relationship.getName() : null; 81 } 82 } 83 | Popular Tags |