1 56 package org.objectstyle.cayenne.map.event; 57 58 import org.objectstyle.cayenne.map.Attribute; 59 import org.objectstyle.cayenne.map.Entity; 60 61 69 public class AttributeEvent extends EntityEvent { 70 protected Attribute attribute; 71 72 73 public AttributeEvent(Object src, Attribute attr, Entity entity) { 74 super(src, entity); 75 setAttribute(attr); 76 } 77 78 79 public AttributeEvent(Object src, Attribute attr, Entity entity, int id) { 80 this(src, attr, entity); 81 setId(id); 82 } 83 84 85 public AttributeEvent(Object src, Attribute attr, Entity entity, String oldName) { 86 87 this(src, attr, entity); 88 setOldName(oldName); 89 } 90 91 92 public Attribute getAttribute() { 93 return attribute; 94 } 95 96 100 public void setAttribute(Attribute attribute) { 101 this.attribute = attribute; 102 } 103 104 public String getNewName() { 105 return (attribute != null) ? attribute.getName() : null; 106 } 107 } | Popular Tags |