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, SET
-
Fields 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
Constructors Constructor Description PersistenceClassElementImpl()Create new PersistenceClassElementImpl with no corresponding name.PersistenceClassElementImpl(String name)Creates new PersistenceClassElementImpl with the corresponding name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeConcurrencyGroups(ConcurrencyGroupElement[] groups, int action)Change the set of concurrency groups.voidchangeFields(PersistenceFieldElement[] fields, int action)Change the set of fields.protected voidfirePropertyChange(String name, Object o, Object n)Fires property change event.protected voidfireVetoableChange(String name, Object o, Object n)Fires vetoable change event.ConcurrencyGroupElementgetConcurrencyGroup(String name)Find a concurrency group by name.ConcurrencyGroupElement[]getConcurrencyGroups()Get all concurrency groups.PersistenceFieldElementgetField(String name)Find a field by name.PersistenceElementCollectiongetFieldCollection()Returns the field collection of this class element.PersistenceFieldElement[]getFields()Get all fields.PersistenceElementCollectiongetGroupCollection()Returns the concurrency group collection of this class element.StringgetKeyClass()Get the fully qualified name of the primary key class for this class element.intgetObjectIdentityType()Get the object identity type of this class element.booleanisModified()Gets 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, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElement.Impl
addPropertyChangeListener, addVetoableChangeListener, attachToElement, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
-
-
-
-
Constructor Detail
-
PersistenceClassElementImpl
public PersistenceClassElementImpl()
Create new PersistenceClassElementImpl with no corresponding name. This constructor should only be used for cloning and archiving.
-
PersistenceClassElementImpl
public PersistenceClassElementImpl(String name)
Creates new PersistenceClassElementImpl with the corresponding name- Parameters:
name- the name of the element
-
-
Method Detail
-
firePropertyChange
protected final void firePropertyChange(String name, Object o, Object n)
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
public void setObjectIdentityType(int type) throws ModelExceptionSet 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
public String 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:
setObjectIdentityType(int),PersistenceClassElement.APPLICATION_IDENTITY
-
setKeyClass
public void setKeyClass(String name) throws ModelException
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:
setObjectIdentityType(int),PersistenceClassElement.APPLICATION_IDENTITY
-
changeFields
public void changeFields(PersistenceFieldElement[] fields, int action) throws ModelException
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
public PersistenceFieldElement[] getFields()
Get all fields.- Specified by:
getFieldsin interfacePersistenceClassElement.Impl- Returns:
- the fields
-
getField
public PersistenceFieldElement getField(String name)
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
public ConcurrencyGroupElement[] getConcurrencyGroups()
Get all concurrency groups.- Specified by:
getConcurrencyGroupsin interfacePersistenceClassElement.Impl- Returns:
- the concurrency groups
-
getConcurrencyGroup
public ConcurrencyGroupElement getConcurrencyGroup(String name)
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
public PersistenceElementCollection 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
public void setFieldCollection(PersistenceElementCollection collection)
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
public PersistenceElementCollection 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
public void setGroupCollection(PersistenceElementCollection collection)
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
-
-