Class PersistenceClassElementImpl
java.lang.Object
com.sun.jdo.api.persistence.model.jdo.impl.PersistenceElementImpl
com.sun.jdo.api.persistence.model.jdo.impl.PersistenceClassElementImpl
- All Implemented Interfaces:
PersistenceClassElement.Impl,PersistenceElement.Impl,PersistenceElementProperties
public class PersistenceClassElementImpl
extends PersistenceElementImpl
implements PersistenceClassElement.Impl
- Version:
- %I%
- Author:
- raccah
-
Field Summary
Fields inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElement.Impl
ADD, REMOVE, SETFields inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElementProperties
PROP_CARDINALITY, PROP_COLLECTION_CLASS, PROP_DELETE_ACTION, PROP_ELEMENT_CLASS, PROP_FIELDS, PROP_GROUPS, PROP_IDENTITY, PROP_INVERSE_FIELD, PROP_KEY_CLASS, PROP_KEY_FIELD, PROP_MODIFIED, PROP_NAME, PROP_PERSISTENCE, PROP_PREFETCH, PROP_SENSITIVITY, PROP_UPDATE_ACTION -
Constructor Summary
ConstructorsConstructorDescriptionCreate new PersistenceClassElementImpl with no corresponding name.Creates new PersistenceClassElementImpl with the corresponding name -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeConcurrencyGroups(ConcurrencyGroupElement[] groups, int action) Change the set of concurrency groups.voidchangeFields(PersistenceFieldElement[] fields, int action) Change the set of fields.protected final voidfirePropertyChange(String name, Object o, Object n) Fires property change event.protected final voidfireVetoableChange(String name, Object o, Object n) Fires vetoable change event.getConcurrencyGroup(String name) Find a concurrency group by name.Get all concurrency groups.Find a field by name.Returns the field collection of this class element.Get all fields.Returns the concurrency group collection of this class element.Get the fully qualified name of the primary key class for this class element.intGet the object identity type of this class element.booleanGets the modified flag for this persistence class.voidsetFieldCollection(PersistenceElementCollection collection) Set the field collection of this class element to the supplied collection.voidsetGroupCollection(PersistenceElementCollection collection) Set the concurrency group collection of this class element to the supplied collection.voidsetKeyClass(String name) Set the primary key class for this class element.voidsetModified(boolean flag) Set the modified flag for this persistence class to flag.voidsetObjectIdentityType(int type) Set the object identity type of this class element.Methods inherited from class com.sun.jdo.api.persistence.model.jdo.impl.PersistenceElementImpl
addPropertyChangeListener, addVetoableChangeListener, attachToElement, getName, removePropertyChangeListener, removeVetoableChangeListener, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElement.Impl
addPropertyChangeListener, addVetoableChangeListener, attachToElement, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
-
Constructor Details
-
PersistenceClassElementImpl
public PersistenceClassElementImpl()Create new PersistenceClassElementImpl with no corresponding name. This constructor should only be used for cloning and archiving. -
PersistenceClassElementImpl
Creates new PersistenceClassElementImpl with the corresponding name- Parameters:
name- the name of the element
-
-
Method Details
-
firePropertyChange
Fires property change event. This method overrides that of PersistenceElementImpl to update the persistence class element's modified status.- Overrides:
firePropertyChangein classPersistenceElementImpl- Parameters:
name- property nameo- old valuen- new value
-
fireVetoableChange
protected final void fireVetoableChange(String name, Object o, Object n) throws PropertyVetoException Fires vetoable change event. This method overrides that of PersistenceElementImpl to give listeners a chance to block changes on the persistence class element modified status.- Overrides:
fireVetoableChangein classPersistenceElementImpl- Parameters:
name- property nameo- old valuen- new value- Throws:
PropertyVetoException- when the change is vetoed by a listener
-
isModified
public boolean isModified()Gets the modified flag for this persistence class.- Specified by:
isModifiedin interfacePersistenceClassElement.Impl- Returns:
trueif there have been (property) changes to this class,falseotherwise.
-
setModified
public void setModified(boolean flag) Set the modified flag for this persistence class to flag. This is usually set totrueby property changes andfalseafter a save.- Specified by:
setModifiedin interfacePersistenceClassElement.Impl- Parameters:
flag- iftrue, this class is marked as modified; iffalse, it is marked as unmodified.
-
getObjectIdentityType
public int getObjectIdentityType()Get the object identity type of this class element.- Specified by:
getObjectIdentityTypein interfacePersistenceClassElement.Impl- Returns:
- the object identity type, one of
PersistenceClassElement.APPLICATION_IDENTITY,PersistenceClassElement.DATABASE_IDENTITY, orPersistenceClassElement.UNMANAGED_IDENTITY. The default is APPLICATION_IDENTITY.
-
setObjectIdentityType
Set the object identity type of this class element.- Specified by:
setObjectIdentityTypein interfacePersistenceClassElement.Impl- Parameters:
type- - an integer indicating the object identity type, one of:PersistenceClassElement.APPLICATION_IDENTITY,PersistenceClassElement.DATABASE_IDENTITY, orPersistenceClassElement.UNMANAGED_IDENTITY- Throws:
ModelException- if impossible
-
getKeyClass
Get the fully qualified name of the primary key class for this class element. This value is only used ifgetObjectIdentityTypereturnsAPPLICATION_IDENTITY- Specified by:
getKeyClassin interfacePersistenceClassElement.Impl- Returns:
- the fully qualified key class name,
nullif the identity type is not managed by the application - See Also:
-
setKeyClass
Set the primary key class for this class element.- Specified by:
setKeyClassin interfacePersistenceClassElement.Impl- Parameters:
name- - the fully qualified name which represents the primary key class. This value is only used ifgetObjectIdentityTypereturnsAPPLICATION_IDENTITY- Throws:
ModelException- if impossible- See Also:
-
changeFields
Change the set of fields.- Specified by:
changeFieldsin interfacePersistenceClassElement.Impl- Parameters:
fields- the new fieldsaction-PersistenceElement.Impl.ADD,PersistenceElement.Impl.REMOVE, orPersistenceElement.Impl.SET- Throws:
ModelException- if impossible
-
getFields
Get all fields.- Specified by:
getFieldsin interfacePersistenceClassElement.Impl- Returns:
- the fields
-
getField
Find a field by name.- Specified by:
getFieldin interfacePersistenceClassElement.Impl- Parameters:
name- the name to match- Returns:
- the field, or
nullif it does not exist
-
changeConcurrencyGroups
public void changeConcurrencyGroups(ConcurrencyGroupElement[] groups, int action) throws ModelException Change the set of concurrency groups.- Specified by:
changeConcurrencyGroupsin interfacePersistenceClassElement.Impl- Parameters:
groups- the new concurrency groupsaction-PersistenceElement.Impl.ADD,PersistenceElement.Impl.REMOVE, orPersistenceElement.Impl.SET- Throws:
ModelException- if impossible
-
getConcurrencyGroups
Get all concurrency groups.- Specified by:
getConcurrencyGroupsin interfacePersistenceClassElement.Impl- Returns:
- the concurrency groups
-
getConcurrencyGroup
Find a concurrency group by name.- Specified by:
getConcurrencyGroupin interfacePersistenceClassElement.Impl- Parameters:
name- the name to match- Returns:
- the concurrency group, or
nullif it does not exist
-
getFieldCollection
Returns the field collection of this class element. This method should only be used internally and for cloning and archiving.- Returns:
- the field collection of this class element
-
setFieldCollection
Set the field collection of this class element to the supplied collection. This method should only be used internally and for cloning and archiving.- Parameters:
collection- the field collection of this class element
-
getGroupCollection
Returns the concurrency group collection of this class element. This method should only be used internally and for cloning and archiving.- Returns:
- the concurrency group collection of this class element
-
setGroupCollection
Set the concurrency group collection of this class element to the supplied collection. This method should only be used internally and for cloning and archiving.- Parameters:
collection- the concurrency group collection of this class element
-