com.sun.jdo.api.persistence.model.jdo
Interface PersistenceClassElement.Impl

All Superinterfaces:
PersistenceElement.Impl
All Known Implementing Classes:
PersistenceClassElementImpl
Enclosing class:
PersistenceClassElement

public static interface PersistenceClassElement.Impl
extends PersistenceElement.Impl

Pluggable implementation of the storage of class element properties.

See Also:
PersistenceClassElement.PersistenceClassElement(com.sun.jdo.api.persistence.model.jdo.PersistenceClassElement.Impl)

Field Summary
 
Fields inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElement.Impl
ADD, REMOVE, SET
 
Method Summary
 void changeConcurrencyGroups(ConcurrencyGroupElement[] groups, int action)
          Change the set of concurrency groups.
 void changeFields(PersistenceFieldElement[] fields, int action)
          Change the set of fields.
 ConcurrencyGroupElement getConcurrencyGroup(String name)
          Find a concurrency group by name.
 ConcurrencyGroupElement[] getConcurrencyGroups()
          Get all concurrency groups.
 PersistenceFieldElement getField(String name)
          Find a field by name.
 PersistenceFieldElement[] getFields()
          Get all fields.
 String getKeyClass()
          Get the fully qualified name of the primary key class for this class element.
 int getObjectIdentityType()
          Get the object identity type of this class element.
 boolean isModified()
          Gets the modified flag for this persistence class.
 void setKeyClass(String name)
          Set the primary key class for this class element.
 void setModified(boolean flag)
          Set the modified flag for this persistence class to flag.
 void setObjectIdentityType(int type)
          Set the object identity type of this class element.
 
Methods inherited from interface com.sun.jdo.api.persistence.model.jdo.PersistenceElement.Impl
addPropertyChangeListener, addVetoableChangeListener, attachToElement, getName, removePropertyChangeListener, removeVetoableChangeListener, setName
 

Method Detail

isModified

boolean isModified()
Gets the modified flag for this persistence class.

Returns:
true if there have been (property) changes to this class, false otherwise.

setModified

void setModified(boolean flag)
Set the modified flag for this persistence class to flag. This is usually set to true by property changes and false after a save.

Parameters:
flag - if true, this class is marked as modified; if false, it is marked as unmodified.

getObjectIdentityType

int getObjectIdentityType()
Get the object identity type of this class element.

Returns:
the object identity type, one of PersistenceClassElement.APPLICATION_IDENTITY, PersistenceClassElement.DATABASE_IDENTITY, or PersistenceClassElement.UNMANAGED_IDENTITY

setObjectIdentityType

void setObjectIdentityType(int type)
                           throws ModelException
Set the object identity type of this class element.

Parameters:
type - - an integer indicating the object identity type, one of: PersistenceClassElement.APPLICATION_IDENTITY, PersistenceClassElement.DATABASE_IDENTITY, or PersistenceClassElement.UNMANAGED_IDENTITY
Throws:
ModelException - if impossible

getKeyClass

String getKeyClass()
Get the fully qualified name of the primary key class for this class element. This value is only used if getObjectIdentityType returns APPLICATION_IDENTITY

Returns:
the fully qualified key class name, null if the identity type is not managed by the application
See Also:
setObjectIdentityType(int), PersistenceClassElement.APPLICATION_IDENTITY

setKeyClass

void setKeyClass(String name)
                 throws ModelException
Set the primary key class for this class element.

Parameters:
name - - the fully qualified name which represents the primary key class. This value is only used if getObjectIdentityType returns APPLICATION_IDENTITY
Throws:
ModelException - if impossible
See Also:
setObjectIdentityType(int), PersistenceClassElement.APPLICATION_IDENTITY

changeFields

void changeFields(PersistenceFieldElement[] fields,
                  int action)
                  throws ModelException
Change the set of fields.

Parameters:
fields - the new fields
action - PersistenceElement.Impl.ADD, PersistenceElement.Impl.REMOVE, or PersistenceElement.Impl.SET
Throws:
ModelException - if impossible

getFields

PersistenceFieldElement[] getFields()
Get all fields.

Returns:
the fields

getField

PersistenceFieldElement getField(String name)
Find a field by name.

Parameters:
name - the name to match
Returns:
the field, or null if it does not exist

changeConcurrencyGroups

void changeConcurrencyGroups(ConcurrencyGroupElement[] groups,
                             int action)
                             throws ModelException
Change the set of concurrency groups.

Parameters:
groups - the new concurrency groups
action - PersistenceElement.Impl.ADD, PersistenceElement.Impl.REMOVE, or PersistenceElement.Impl.SET
Throws:
ModelException - if impossible

getConcurrencyGroups

ConcurrencyGroupElement[] getConcurrencyGroups()
Get all concurrency groups.

Returns:
the concurrency groups

getConcurrencyGroup

ConcurrencyGroupElement getConcurrencyGroup(String name)
Find a concurrency group by name.

Parameters:
name - the name to match
Returns:
the concurrency group, or null if it does not exist


Copyright © 2012 GlassFish Community. All Rights Reserved.