1 19 20 package org.apache.cayenne.map.event; 21 22 import org.apache.cayenne.map.Attribute; 23 import org.apache.cayenne.map.Entity; 24 25 33 public class AttributeEvent extends EntityEvent { 34 protected Attribute attribute; 35 36 37 public AttributeEvent(Object src, Attribute attr, Entity entity) { 38 super(src, entity); 39 setAttribute(attr); 40 } 41 42 43 public AttributeEvent(Object src, Attribute attr, Entity entity, int id) { 44 this(src, attr, entity); 45 setId(id); 46 } 47 48 49 public AttributeEvent(Object src, Attribute attr, Entity entity, String oldName) { 50 51 this(src, attr, entity); 52 setOldName(oldName); 53 } 54 55 56 public Attribute getAttribute() { 57 return attribute; 58 } 59 60 64 public void setAttribute(Attribute attribute) { 65 this.attribute = attribute; 66 } 67 68 public String getNewName() { 69 return (attribute != null) ? attribute.getName() : null; 70 } 71 } 72 | Popular Tags |