1 19 20 package org.apache.cayenne.map.event; 21 22 import org.apache.cayenne.map.Entity; 23 24 29 public class EntityEvent extends MapEvent { 30 protected Entity entity; 31 32 33 public EntityEvent(Object src, Entity entity) { 34 super(src); 35 setEntity(entity); 36 } 37 38 39 public EntityEvent(Object src, Entity entity, int id) { 40 this(src, entity); 41 setId(id); 42 } 43 44 45 public EntityEvent(Object src, Entity entity, String oldName) { 46 this(src, entity); 47 setOldName(oldName); 48 } 49 50 51 public Entity getEntity() { 52 return entity; 53 } 54 55 60 public void setEntity(Entity entity) { 61 this.entity = entity; 62 } 63 64 public String getNewName() { 65 return (entity != null) ? entity.getName() : null; 66 } 67 } 68 | Popular Tags |