/** Fires vetoable change event. This method overrides that of * MappingElementImpl to give listeners a chance to block * changes on the mapping class element modified status. * @param name property name * @param o old value * @param n new value * @exception PropertyVetoException when the change is vetoed by a listener */ protected final void fireVetoableChange (String name, Object o, Object n) throws PropertyVetoException { // even though o == null and n == null will signify a change, that // is consistent with PropertyChangeSupport's behavior and is // necessary for this to work boolean noChange = ((o != null) && (n != null) && o.equals(n)); super.fireVetoableChange(name, o, n); if (!(PROP_MODIFIED.equals(name)) && !noChange) fireVetoableChange(PROP_MODIFIED, Boolean.FALSE, Boolean.TRUE); }
/** Fires vetoable change event. This method overrides that of * MappingElementImpl to give listeners a chance to block * changes on the mapping class element modified status. * @param name property name * @param o old value * @param n new value * @exception PropertyVetoException when the change is vetoed by a listener */ protected final void fireVetoableChange (String name, Object o, Object n) throws PropertyVetoException { // even though o == null and n == null will signify a change, that // is consistent with PropertyChangeSupport's behavior and is // necessary for this to work boolean noChange = ((o != null) && (n != null) && o.equals(n)); super.fireVetoableChange(name, o, n); if (!(PROP_MODIFIED.equals(name)) && !noChange) fireVetoableChange(PROP_MODIFIED, Boolean.FALSE, Boolean.TRUE); }
/** Fires vetoable change event. This method overrides that of * MappingElementImpl to give listeners a chance to block * changes on the mapping class element modified status. * @param name property name * @param o old value * @param n new value * @exception PropertyVetoException when the change is vetoed by a listener */ protected final void fireVetoableChange (String name, Object o, Object n) throws PropertyVetoException { // even though o == null and n == null will signify a change, that // is consistent with PropertyChangeSupport's behavior and is // necessary for this to work boolean noChange = ((o != null) && (n != null) && o.equals(n)); MappingClassElement classElement = getDeclaringClass(); super.fireVetoableChange(name, o, n); if ((classElement != null) && !noChange) { ((MappingClassElementImpl)classElement).fireVetoableChange( PROP_MODIFIED, Boolean.FALSE, Boolean.TRUE); } }
/** Fires vetoable change event. This method overrides that of * MappingElementImpl to give listeners a chance to block * changes on the mapping class element modified status. * @param name property name * @param o old value * @param n new value * @exception PropertyVetoException when the change is vetoed by a listener */ protected final void fireVetoableChange (String name, Object o, Object n) throws PropertyVetoException { // even though o == null and n == null will signify a change, that // is consistent with PropertyChangeSupport's behavior and is // necessary for this to work boolean noChange = ((o != null) && (n != null) && o.equals(n)); MappingClassElement classElement = getDeclaringClass(); super.fireVetoableChange(name, o, n); if ((classElement != null) && !noChange) { ((MappingClassElementImpl)classElement).fireVetoableChange( PROP_MODIFIED, Boolean.FALSE, Boolean.TRUE); } }
/** Adds a field to the list of fields in this mapping class. * @param field field element to be added * @exception ModelException if impossible */ public void addField (MappingFieldElement field) throws ModelException { ArrayList fields = getFields(); if (!fields.contains(field)) { try { fireVetoableChange(PROP_FIELDS, null, null); fields.add(field); firePropertyChange(PROP_FIELDS, null, null); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } } }
/** Adds a field to the list of fields in this mapping class. * @param field field element to be added * @exception ModelException if impossible */ public void addField (MappingFieldElement field) throws ModelException { ArrayList fields = getFields(); if (!fields.contains(field)) { try { fireVetoableChange(PROP_FIELDS, null, null); fields.add(field); firePropertyChange(PROP_FIELDS, null, null); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } } }
/** Set the consistency level of this mapping class. * @param level an integer indicating the consistency level, one of: * {@link #NONE_CONSISTENCY},{@link #CHECK_MODIFIED_AT_COMMIT_CONSISTENCY}, * {@link #CHECK_ALL_AT_COMMIT_CONSISTENCY}, * {@link #LOCK_WHEN_MODIFIED_CONSISTENCY}, * {@link #LOCK_WHEN_MODIFIED_CHECK_ALL_AT_COMMIT_CONSISTENCY}, * {@link #LOCK_WHEN_LOADED_CONSISTENCY}, or * {@link #VERSION_CONSISTENCY}. * @exception ModelException if impossible. */ public void setConsistencyLevel (int level) throws ModelException { Integer old = new Integer(getConsistencyLevel()); Integer newLevel = new Integer(level); try { fireVetoableChange(PROP_CONSISTENCY, old, newLevel); _consistencyLevel = level; firePropertyChange(PROP_CONSISTENCY, old, newLevel); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
/** Set the consistency level of this mapping class. * @param level an integer indicating the consistency level, one of: * {@link #NONE_CONSISTENCY},{@link #CHECK_MODIFIED_AT_COMMIT_CONSISTENCY}, * {@link #CHECK_ALL_AT_COMMIT_CONSISTENCY}, * {@link #LOCK_WHEN_MODIFIED_CONSISTENCY}, * {@link #LOCK_WHEN_MODIFIED_CHECK_ALL_AT_COMMIT_CONSISTENCY}, * {@link #LOCK_WHEN_LOADED_CONSISTENCY}, or * {@link #VERSION_CONSISTENCY}. * @exception ModelException if impossible. */ public void setConsistencyLevel (int level) throws ModelException { Integer old = new Integer(getConsistencyLevel()); Integer newLevel = new Integer(level); try { fireVetoableChange(PROP_CONSISTENCY, old, newLevel); _consistencyLevel = level; firePropertyChange(PROP_CONSISTENCY, old, newLevel); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
/** Removes a field from the list of fields in this mapping class. * @param field field element to be removed * @exception ModelException if impossible */ public void removeField (MappingFieldElement field) throws ModelException { try { fireVetoableChange(PROP_FIELDS, null, null); if (!getFields().remove(field)) { throw new ModelException(I18NHelper.getMessage(getMessages(), "mapping.element.element_not_removed", field)); // NOI18N } firePropertyChange(PROP_FIELDS, null, null); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
/** Removes a field from the list of fields in this mapping class. * @param field field element to be removed * @exception ModelException if impossible */ public void removeField (MappingFieldElement field) throws ModelException { try { fireVetoableChange(PROP_FIELDS, null, null); if (!getFields().remove(field)) { throw new ModelException(I18NHelper.getMessage(getMessages(), "mapping.element.element_not_removed", field)); // NOI18N } firePropertyChange(PROP_FIELDS, null, null); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
/** Set the navigable flag for this mapping class to flag. * @param flag if <code>true</code>, lazy initialization will be used; * if <code>false</code>, access to a non-fetched field will result in an * exception. * @exception ModelException if impossible */ public void setNavigable (boolean flag) throws ModelException { Boolean old = JavaTypeHelper.valueOf(isNavigable()); Boolean newFlag = JavaTypeHelper.valueOf(flag); try { fireVetoableChange(PROP_NAVIGABLE, old, newFlag); _properties = (flag) ? (_properties | NAVIGABLE) : (_properties & ~NAVIGABLE); firePropertyChange(PROP_NAVIGABLE, old, newFlag); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
/** Set the navigable flag for this mapping class to flag. * @param flag if <code>true</code>, lazy initialization will be used; * if <code>false</code>, access to a non-fetched field will result in an * exception. * @exception ModelException if impossible */ public void setNavigable (boolean flag) throws ModelException { Boolean old = JavaTypeHelper.valueOf(isNavigable()); Boolean newFlag = JavaTypeHelper.valueOf(flag); try { fireVetoableChange(PROP_NAVIGABLE, old, newFlag); _properties = (flag) ? (_properties | NAVIGABLE) : (_properties & ~NAVIGABLE); firePropertyChange(PROP_NAVIGABLE, old, newFlag); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
/** Set the database root for this MappingClassElement. * The root represents the database used by the tables mapped to * this mapping class. * @param root the new database root * @exception ModelException if impossible */ public void setDatabaseRoot (SchemaElement root) throws ModelException { String old = getDatabaseRoot(); String newRoot = ((root != null) ? root.getName().getFullName() : null); try { fireVetoableChange(PROP_DATABASE_ROOT, old, newRoot); _databaseRoot = newRoot; firePropertyChange(PROP_DATABASE_ROOT, old, newRoot); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
/** Set the database root for this MappingClassElement. * The root represents the database used by the tables mapped to * this mapping class. * @param root the new database root * @exception ModelException if impossible */ public void setDatabaseRoot (SchemaElement root) throws ModelException { String old = getDatabaseRoot(); String newRoot = ((root != null) ? root.getName().getFullName() : null); try { fireVetoableChange(PROP_DATABASE_ROOT, old, newRoot); _databaseRoot = newRoot; firePropertyChange(PROP_DATABASE_ROOT, old, newRoot); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
fireVetoableChange(PROP_TABLES, null, null); found = tables.remove(table); firePropertyChange(PROP_TABLES, null, null);
fireVetoableChange(PROP_TABLES, null, null); found = tables.remove(table); firePropertyChange(PROP_TABLES, null, null);
fireVetoableChange(PROP_TABLES, null, null); parentTable.addReferencingKey(key); tables.add(mappingTable);
fireVetoableChange(PROP_TABLES, null, null); parentTable.addReferencingKey(key); tables.add(mappingTable);
fireVetoableChange(PROP_TABLES, null, null); tables.add(mappingTable); firePropertyChange(PROP_TABLES, null, null);
fireVetoableChange(PROP_TABLES, null, null); tables.add(mappingTable); firePropertyChange(PROP_TABLES, null, null);