/** * @see org.apache.cayenne.map.Entity#removeAttribute(String) */ public void removeAttribute(String attrName) { super.removeAttribute(attrName); }
private void addToDbEntity(DbEntity entity, DbAttribute attribute) { attribute.setEntity(entity); // override existing attributes if it comes again if (entity.getAttribute(attribute.getName()) != null) { entity.removeAttribute(attribute.getName()); } entity.addAttribute(attribute); }
public void removeDbAttributes(DataMap dataMap, DbEntity entity, DbAttribute[] attribs) { ProjectController mediator = getProjectController(); for (DbAttribute attrib : attribs) { entity.removeAttribute(attrib.getName()); AttributeEvent e = new AttributeEvent( Application.getFrame(), attrib, entity, MapEvent.REMOVE); mediator.fireDbAttributeEvent(e); } ProjectUtil.cleanObjMappings(dataMap); }
private void removeDbAttributes(ProjectController mediator, ConfirmRemoveDialog dialog, DbAttribute[] dbAttrs) { if (dbAttrs != null && dbAttrs.length > 0) { if ((dbAttrs.length == 1 && dialog.shouldDelete("DbAttribute", dbAttrs[0].getName())) || (dbAttrs.length > 1 && dialog.shouldDelete("selected DbAttributes"))) { DbEntity entity = mediator.getCurrentDbEntity(); application.getUndoManager() .addEdit(new RemoveAttributeUndoableEdit(entity, dbAttrs)); for (DbAttribute attrib : dbAttrs) { entity.removeAttribute(attrib.getName()); AttributeEvent e = new AttributeEvent(Application.getFrame(), attrib, entity, MapEvent.REMOVE); mediator.fireDbAttributeEvent(e); } ProjectUtil.cleanObjMappings(mediator.getCurrentDataMap()); } } }
getEntity().removeAttribute(getColumn().getName());