/** * * @since 4.0 */ public void updateAttribute(Attribute attribute) { removeAttribute(attribute.getName()); addAttribute(attribute); }
/** * Adds a new attribute to this entity. * * @throws IllegalArgumentException if Attribute has no name or there is an existing attribute * with the same name * @throws IllegalArgumentException if a relationship has the same name as this attribute * @since 3.0 */ public void addAttribute(DbAttribute attr) { super.addAttribute(attr); this.dbAttributeAdded(new AttributeEvent(this, attr, this, MapEvent.ADD)); }
/** * Overrides super to fire an AttributeEvent. */ public void addAttribute(Attribute attr) { super.addAttribute(attr); this.dbAttributeAdded(new AttributeEvent(this, attr, this, MapEvent.ADD)); }
/** * Changes the name of the attribute and all references to this attribute. */ public static void setAttributeName(Attribute attribute, String newName) { String oldName = attribute.getName(); attribute.setName(newName); Entity entity = attribute.getEntity(); if (entity != null) { entity.removeAttribute(oldName); entity.addAttribute(attribute); } }
super.addAttribute(dbAttr);
super.addAttribute(dbAttribute);