/** Notifies all listeners of the change(add, remove) and does the change. */ public void fireDbAttributeEvent(AttributeEvent e) { setDirty(true); for (EventListener listener : listenerList.getListeners(DbAttributeListener.class)) { DbAttributeListener temp = (DbAttributeListener) listener; switch (e.getId()) { case MapEvent.ADD: temp.dbAttributeAdded(e); break; case MapEvent.CHANGE: temp.dbAttributeChanged(e); break; case MapEvent.REMOVE: temp.dbAttributeRemoved(e); break; default: throw new IllegalArgumentException("Invalid AttributeEvent type: " + e.getId()); } } }
/** * Updates attribute "primaryKey" property. */ public void setPrimaryKey(boolean primaryKey) { if (this.primaryKey != primaryKey) { this.primaryKey = primaryKey; Entity e = this.getEntity(); if (e instanceof DbAttributeListener) { ((DbAttributeListener) e).dbAttributeChanged(new AttributeEvent(this, this, e)); } } }
/** * Updates attribute "primaryKey" property. */ public void setPrimaryKey(boolean primaryKey) { if (this.primaryKey != primaryKey) { this.primaryKey = primaryKey; Entity e = this.getEntity(); if (e instanceof DbAttributeListener) { ((DbAttributeListener) e).dbAttributeChanged(new AttributeEvent( this, this, e)); } } }
/** * Updates attribute "generated" property. * * @since 1.2 */ public void setGenerated(boolean generated) { if (this.generated != generated) { this.generated = generated; Entity e = this.getEntity(); if (e instanceof DbAttributeListener) { ((DbAttributeListener) e).dbAttributeChanged(new AttributeEvent(this, this, e)); } } }
/** * Updates attribute "generated" property. * * @since 1.2 */ public void setGenerated(boolean generated) { if (this.generated != generated) { this.generated = generated; Entity e = this.getEntity(); if (e instanceof DbAttributeListener) { ((DbAttributeListener) e).dbAttributeChanged(new AttributeEvent( this, this, e)); } } } }