/** 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); } }
/** Set the modified flag for this mapping class to flag. This is usually * set to <code>true</code> by property changes and <code>false</code> * after a save. * @param flag if <code>true</code>, this class is marked as modified; * if <code>false</code>, it is marked as unmodified. */ public void setModified (boolean flag) { boolean oldFlag = isModified(); if (flag != oldFlag) { _isModified = flag; firePropertyChange(PROP_MODIFIED, JavaTypeHelper.valueOf(oldFlag), JavaTypeHelper.valueOf(flag)); } }
/** Set the modified flag for this mapping class to flag. This is usually * set to <code>true</code> by property changes and <code>false</code> * after a save. * @param flag if <code>true</code>, this class is marked as modified; * if <code>false</code>, it is marked as unmodified. */ public void setModified (boolean flag) { boolean oldFlag = isModified(); if (flag != oldFlag) { _isModified = flag; firePropertyChange(PROP_MODIFIED, JavaTypeHelper.valueOf(oldFlag), JavaTypeHelper.valueOf(flag)); } }
/** 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); } }
firePropertyChange(PROP_TABLES, null, null);
firePropertyChange(PROP_TABLES, null, null);
parentTable.addReferencingKey(key); tables.add(mappingTable); firePropertyChange(PROP_TABLES, null, null);
parentTable.addReferencingKey(key); tables.add(mappingTable); firePropertyChange(PROP_TABLES, null, null);
firePropertyChange(PROP_TABLES, null, null);
firePropertyChange(PROP_TABLES, null, null);