1 56 package org.objectstyle.cayenne.map.event; 57 58 import org.objectstyle.cayenne.map.Entity; 59 60 65 public class EntityEvent extends MapEvent { 66 protected Entity entity; 67 68 69 public EntityEvent(Object src, Entity entity) { 70 super(src); 71 setEntity(entity); 72 } 73 74 75 public EntityEvent(Object src, Entity entity, int id) { 76 this(src, entity); 77 setId(id); 78 } 79 80 81 public EntityEvent(Object src, Entity entity, String oldName) { 82 this(src, entity); 83 setOldName(oldName); 84 } 85 86 87 public Entity getEntity() { 88 return entity; 89 } 90 91 96 public void setEntity(Entity entity) { 97 this.entity = entity; 98 } 99 100 public String getNewName() { 101 return (entity != null) ? entity.getName() : null; 102 } 103 } | Popular Tags |