/** Returns the list of version fields (MappingFieldElements) in this * mapping class. This list only includes fields if the consistency * level is {@link #VERSION_CONSISTENCY}. * @return the version fields in this mapping class */ public List getVersionFields () { List versionFields = new ArrayList(); if (VERSION_CONSISTENCY == getConsistencyLevel()) { Iterator iterator = getFields().iterator(); while (iterator.hasNext()) { MappingFieldElement fieldCandidate = (MappingFieldElement)iterator.next(); if (fieldCandidate.isVersion()) versionFields.add(fieldCandidate); } } return versionFields; }
/** Returns the list of version fields (MappingFieldElements) in this * mapping class. This list only includes fields if the consistency * level is {@link #VERSION_CONSISTENCY}. * @return the version fields in this mapping class */ public List getVersionFields () { List versionFields = new ArrayList(); if (VERSION_CONSISTENCY == getConsistencyLevel()) { Iterator iterator = getFields().iterator(); while (iterator.hasNext()) { MappingFieldElement fieldCandidate = (MappingFieldElement)iterator.next(); if (fieldCandidate.isVersion()) versionFields.add(fieldCandidate); } } return versionFields; }
/** 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); } }