public class PersistenceClassElement extends PersistenceElement implements FieldElementHolder
Modifier and Type | Class and Description |
---|---|
static interface |
PersistenceClassElement.Impl
Pluggable implementation of the storage of class element properties.
|
Modifier and Type | Field and Description |
---|---|
static int |
APPLICATION_IDENTITY
Constant representing jdo identity managed by the application.
|
static int |
DATABASE_IDENTITY
Constant representing jdo identity managed by the database.
|
static int |
UNMANAGED_IDENTITY
Constant representing unmanaged jdo identity.
|
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 and Description |
---|
PersistenceClassElement()
Create new PersistenceClassElement with no implementation.
|
PersistenceClassElement(PersistenceClassElement.Impl impl)
Create new PersistenceClassElement with the provided implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
addConcurrencyGroup(ConcurrencyGroupElement group)
Add the supplied group to the collection of concurrency groups for this
class.
|
void |
addConcurrencyGroups(ConcurrencyGroupElement[] groups)
Add the supplied groups to the collection of concurrency groups for
this class.
|
void |
addField(PersistenceFieldElement field)
Add the supplied field to the collection of fields maintained by this
holder.
|
void |
addFields(PersistenceFieldElement[] fields)
Add the supplied fields to the collection of fields maintained by this
holder.
|
boolean |
containsConcurrencyGroup(ConcurrencyGroupElement group)
Tests whether the supplied group is in the collection of groups
maintained by this class.
|
boolean |
containsField(PersistenceFieldElement field)
Tests whether the supplied field is in the collection of fields
maintained by this holder.
|
static PersistenceClassElement |
forName(String name,
Model model)
Returns the persistence class element associated with the class with
the given string name, using the given model object to look it up.
|
ConcurrencyGroupElement |
getConcurrencyGroup(String name)
Returns the concurrency group with the supplied name from the
collection of groups maintained by this class.
|
ConcurrencyGroupElement[] |
getConcurrencyGroups()
Returns the collection of fields groups by this class in the form
of an array.
|
PersistenceFieldElement |
getField(String name)
Returns the field with the supplied name from the collection of fields
maintained by this holder.
|
PersistenceFieldElement[] |
getFields()
Returns the collection of fields maintained by this holder in the form
of an array.
|
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.
|
String |
getPackage()
Get the package name of this class element.
|
RelationshipElement |
getRelationship(String name)
Returns the relationship with the supplied name from the collection of
relationships maintained by this holder.
|
RelationshipElement[] |
getRelationships()
Returns the subset of the collection of fields which are relationahips.
|
boolean |
isModified()
Gets the modified flag for this persistence class.
|
void |
removeConcurrencyGroup(ConcurrencyGroupElement group)
Remove the supplied group from the collection of concurrency groups for
this class.
|
void |
removeConcurrencyGroups(ConcurrencyGroupElement[] groups)
Removed the supplied groups from the collection of concurrency groups
for this class.
|
void |
removeField(PersistenceFieldElement field)
Remove the supplied field from the collection of fields maintained by
this holder.
|
void |
removeFields(PersistenceFieldElement[] fields)
Removed the supplied fields from the collection of fields maintained
by this holder.
|
void |
setConcurrencyGroups(ConcurrencyGroupElement[] groups)
Sets the collection of concurrency groups maintained by this class to
the contents of the supplied array.
|
void |
setFields(PersistenceFieldElement[] fields)
Sets the collection of fields maintained by this holder to the contents
of the supplied array.
|
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 |
setName(String name)
Set the name of this persistence element.
|
void |
setObjectIdentityType(int type)
Set the object identity type of this class element.
|
addPropertyChangeListener, addVetoableChangeListener, compareTo, equals, getImpl, getMessages, getName, hashCode, removePropertyChangeListener, removeVetoableChangeListener, setImpl, toString
public static final int APPLICATION_IDENTITY
public static final int DATABASE_IDENTITY
public static final int UNMANAGED_IDENTITY
public PersistenceClassElement()
public PersistenceClassElement(PersistenceClassElement.Impl impl)
impl
- the implementation to usepublic static PersistenceClassElement forName(String name, Model model)
name
- the fully qualified name of the desired classmodel
- the model object to be used to look it uppublic String getPackage()
PersistenceElement.getName()
public boolean isModified()
true
if there have been (property) changes to this
class, false
otherwise.public void setModified(boolean flag)
true
by property changes and
false
after a save.flag
- if true
, this class is marked as modified;
if false
, it is marked as unmodified.public int getObjectIdentityType()
APPLICATION_IDENTITY
,
DATABASE_IDENTITY
, or UNMANAGED_IDENTITY
public void setObjectIdentityType(int type) throws ModelException
type
- - an integer indicating the object identity type, one of:
APPLICATION_IDENTITY
, DATABASE_IDENTITY
, or
UNMANAGED_IDENTITY
ModelException
- if impossiblepublic String getKeyClass()
getObjectIdentityType
returns APPLICATION_IDENTITY
null
if the
identity type is not managed by the applicationsetObjectIdentityType(int)
,
APPLICATION_IDENTITY
public void setKeyClass(String name) throws ModelException
name
- - the fully qualified name which represents the primary key
class. This value is only used if getObjectIdentityType
returns APPLICATION_IDENTITY
ModelException
- if impossiblesetObjectIdentityType(int)
,
APPLICATION_IDENTITY
public void setName(String name) throws ModelException
key class
in sync if possible.setName
in class PersistenceElement
name
- the nameModelException
- if impossiblepublic void addField(PersistenceFieldElement field) throws ModelException
addField
in interface FieldElementHolder
field
- the field to be addedModelException
- if impossiblepublic void addFields(PersistenceFieldElement[] fields) throws ModelException
addFields
in interface FieldElementHolder
fields
- the array of fields to be addedModelException
- if impossiblepublic void removeField(PersistenceFieldElement field) throws ModelException
removeField
in interface FieldElementHolder
field
- the field to be removedModelException
- if impossiblepublic void removeFields(PersistenceFieldElement[] fields) throws ModelException
removeFields
in interface FieldElementHolder
fields
- the array of fields to be removedModelException
- if impossiblepublic PersistenceFieldElement[] getFields()
getFields
in interface FieldElementHolder
public void setFields(PersistenceFieldElement[] fields) throws ModelException
setFields
in interface FieldElementHolder
fields
- the fields maintained by this holderModelException
- if impossiblepublic PersistenceFieldElement getField(String name)
getField
in interface FieldElementHolder
name
- the name of the field to be foundnull
if none
existspublic boolean containsField(PersistenceFieldElement field)
containsField
in interface FieldElementHolder
field
- the field to be testedpublic RelationshipElement[] getRelationships()
getFields()
public RelationshipElement getRelationship(String name)
name
- the name of the relationship to be foundnull
if
none existsgetRelationships()
,
getField(java.lang.String)
public void addConcurrencyGroup(ConcurrencyGroupElement group) throws ModelException
group
- the concurrency group to be addedModelException
- if impossiblepublic void addConcurrencyGroups(ConcurrencyGroupElement[] groups) throws ModelException
groups
- the array of concurrency groups to be addedModelException
- if impossiblepublic void removeConcurrencyGroup(ConcurrencyGroupElement group) throws ModelException
group
- the concurrency group to be removedModelException
- if impossiblepublic void removeConcurrencyGroups(ConcurrencyGroupElement[] groups) throws ModelException
groups
- the array of concurrency groups to be removedModelException
- if impossiblepublic ConcurrencyGroupElement[] getConcurrencyGroups()
public void setConcurrencyGroups(ConcurrencyGroupElement[] groups) throws ModelException
groups
- the concurrency groups maintained by this holderModelException
- if impossiblepublic ConcurrencyGroupElement getConcurrencyGroup(String name)
name
- the name of the concurrency group to be foundnull
if none existspublic boolean containsConcurrencyGroup(ConcurrencyGroupElement group)
group
- the concurrency group to be testedCopyright © 2018. All rights reserved.