public interface JDOClass extends JDOMember
Modifier and Type | Method and Description |
---|---|
JDOClass |
createJDOClass(java.lang.String name)
This method returns a JDOClass instance representing an inner class of
this JDOClass If this JDOClass already declares such an inner class,
the existing JDOClass instance is returned.
|
JDOField |
createJDOField(java.lang.String name)
This method returns a JDOField instance for the field with the specified
name.
|
JDOClass[] |
getDeclaredClasses()
Returns the collection of JDOClass instances declared by this JDOClass.
|
JDOField |
getDeclaredField(java.lang.String fieldName)
Returns JDOField metadata for a particular declared field specified by
field name.
|
JDOField[] |
getDeclaredFields()
Returns the collection of JDOField instances declared by this JDOClass
in the form of an array.
|
int |
getDeclaredManagedFieldCount()
Returns the number of managed fields declared in the class represented
by this JDOClass.
|
JDOField[] |
getDeclaredManagedFields()
Returns the collection of managed JDOField instances declared by this
JDOClass in the form of an array.
|
JDOMember[] |
getDeclaredMembers()
Returns the collection of JDOMember instances declared by this JDOClass
in form of an array.
|
java.lang.String |
getDeclaredObjectIdClassName()
Get the fully qualified name of the object identity class
(primary key class) declared for this JDOClass.
|
JDOModel |
getDeclaringModel()
Returns the declaring JDOModel of this JDOClass.
|
JDOField[] |
getDefaultFetchGroupFields()
Returns the collection of default fetch group fields of this JDOClass
in the form of an array.
|
JDOField |
getField(int fieldNumber)
Provides metadata for a particular field specified by the absolute field
number.
|
JDOField |
getField(java.lang.String fieldName)
Returns JDOField metadata for a particular field specified by field name.
|
int |
getIdentityType()
Get the JDO identity type of this JDOClass.
|
int |
getInheritedManagedFieldCount()
Returns the number of inherited managed fields for the class
represented by this JDOClass.
|
JavaType |
getJavaType()
Provides the JavaType representaion corresponding to this JDOClass.
|
JDOPackage |
getJDOPackage()
Returns the JDOPackage instance corresponding to the package name
of this JDOClass.
|
JDOField |
getManagedField(java.lang.String fieldName)
Returns JDOField metadata for a particular managed field specified by
field name.
|
int |
getManagedFieldCount()
Returns the number of managed fields for the class represented by this
JDOClass.
|
int[] |
getManagedFieldNumbers()
Returns an array of absolute field numbers of the managed fields of this
JDOClass.
|
JDOField[] |
getManagedFields()
Returns the collection of managed JDOField instances of this JDOClass
in the form of an array.
|
JavaType |
getObjectIdClass()
Get the JavaType representation of the object identity class
(primary key class) for this JDOClass.
|
java.lang.String |
getPackagePrefix()
Returns the package name including a terminating dot if this class has a
package.
|
JDOClass |
getPersistenceCapableRootClass()
Returns the least-derived (topmost) persistence-capable class in the
hierarchy of this JDOClass.
|
JDOClass |
getPersistenceCapableSuperclass()
Returns the JDOClass instance for the persistence-capable superclass
of this JDOClass.
|
java.lang.String |
getPersistenceCapableSuperclassName()
Get the fully qualified class name of the persistence-capable superclass
of the persistence-capable class described by this JDOClass.
|
int[] |
getPersistentFieldNumbers()
Returns an array of absolute field numbers of the persistent fields of
this JDOClass.
|
JDOField[] |
getPersistentFields()
Returns the collection of persistent JDOField instances of this JDOClass
in the form of an array.
|
int[] |
getPersistentNonPrimaryKeyFieldNumbers()
Returns an array of absolute field numbers of the non identifying,
persistent fields of this JDOClass.
|
int[] |
getPersistentRelationshipFieldNumbers()
Returns an array of absolute field numbers of persistent relationship
fields of this JDOClass.
|
JDOField[] |
getPersistentRelationshipFields()
Returns the collection of persistent relationship fields of this JDOClass
in the form of an array.
|
int[] |
getPersistentSerializableFieldNumbers()
Returns an array of absolute field numbers of persistent, serializable
fields of this JDOClass.
|
int[] |
getPrimaryKeyFieldNumbers()
Returns an array of absolute field numbers of the identifying fields
of this JDOClass.
|
JDOField[] |
getPrimaryKeyFields()
Returns the collection of identifying fields of this JDOClass in the form
of an array.
|
boolean |
isXMLMetadataLoaded()
Determines whether the XML metadata for the class represented by this
JDOClass has been loaded.
|
void |
removeDeclaredMember(JDOMember member)
Remove the supplied member from the collection of members maintained by
this JDOClass.
|
boolean |
requiresExtent()
Determines whether an extent must be managed for the
persistence-capable class described by this JDOClass.
|
void |
setDeclaredObjectIdClassName(java.lang.String declaredObjectIdClassName)
Set the fully qualified name of the object identity class
(primary key class) declared for this JDOClass.
|
void |
setDeclaringModel(JDOModel model)
Set the declaring JDOModel for this JDOClass.
|
void |
setIdentityType(int identityType)
Set the object identity type of this JDOClass.
|
void |
setJavaType(JavaType javaType)
Set the JavaType representation corresponding to this JDOClass.
|
void |
setJDOPackage(JDOPackage jdoPackage)
Sets the JDOPackage instance corresponding to the package name
of this JDOClass.
|
void |
setObjectIdClass(JavaType objectIdClass)
Set the JavaType representation of the object identity class
(primary key class) for this JDOClass.
|
void |
setPersistenceCapableSuperclass(JDOClass pcSuperclass)
Set the JDOClass for the persistence-capable superclass
of this JDOClass.
|
void |
setPersistenceCapableSuperclassName(java.lang.String pcSuperclassName)
Set the fully qualified class name of the persistence-capable superclass
of the persistence-capable class described by this JDOClass.
|
void |
setRequiresExtent(boolean requiresExtent)
Set whether an extent must be managed for the
persistence-capable class described by this JDOClass.
|
void |
setXMLMetadataLoaded()
Sets the flag indicating that the class XML metadata for this
JDOClass is loaded to
true . |
getDeclaringClass, getName, setDeclaringClass, setName
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener
int getIdentityType()
JDOIdentityType.APPLICATION
if objectid-class is
specified, and JDOIdentityType.DATASTORE
, if not.JDOIdentityType.APPLICATION
,
JDOIdentityType.DATASTORE
, or
JDOIdentityType.NONDURABLE
void setIdentityType(int identityType) throws ModelException
identityType
- an integer indicating the JDO identity type, one of:
JDOIdentityType.APPLICATION
,
JDOIdentityType.DATASTORE
, or
JDOIdentityType.NONDURABLE
ModelException
- if impossibleJavaType getObjectIdClass()
void setObjectIdClass(JavaType objectIdClass) throws ModelException
objectIdClass
- the JavaType representation of the
object identity class.ModelException
- if impossiblejava.lang.String getDeclaredObjectIdClassName()
null
. This is different from method
getObjectIdClass()
which returns a non-null value, if the
superclass defines a objectIdClass.void setDeclaredObjectIdClassName(java.lang.String declaredObjectIdClassName) throws ModelException
declaredObjectIdClassName
- the name of the object identity classModelException
- if impossibleboolean requiresExtent()
true if this class must manage an extent;
false
otherwise
void setRequiresExtent(boolean requiresExtent) throws ModelException
requiresExtent
- true
if this class must manage
an extent; false
otherwiseModelException
- if impossiblejava.lang.String getPersistenceCapableSuperclassName()
null
is returned.null
if there is no persistence-capable superclassvoid setPersistenceCapableSuperclassName(java.lang.String pcSuperclassName) throws ModelException
pcSuperclassName
- the fully qualified name of the
persistence-capable superclassModelException
- if impossibleJavaType getJavaType()
Note the difference between Object.getClass) and this method. The former returns the class of the object in hand, this returns the class of the object represented by this meta data.
void setJavaType(JavaType javaType) throws ModelException
javaType
- the JavaType representation for this JDOClass.ModelException
- if impossibleboolean isXMLMetadataLoaded()
true
if XML metadata is loaded;
false
otherwisevoid setXMLMetadataLoaded()
true
.void removeDeclaredMember(JDOMember member) throws ModelException
member
- the member to be removedModelException
- if impossibleJDOMember[] getDeclaredMembers()
JDOModel getDeclaringModel()
void setDeclaringModel(JDOModel model)
model
- the declaring JDOModel of this JDOClassJDOClass getPersistenceCapableSuperclass()
null
is returned.null
if there is no persistence-capable superclassvoid setPersistenceCapableSuperclass(JDOClass pcSuperclass) throws ModelException
pcSuperclass
- the JDClass instance of the persistence-capable
superclassModelException
- if impossibleJDOPackage getJDOPackage()
void setJDOPackage(JDOPackage jdoPackage)
jdoPackage
- the JDOPackage of this JDOClass.JDOField createJDOField(java.lang.String name) throws ModelException
name
- the name of the fieldModelException
- if impossibleJDOClass createJDOClass(java.lang.String name) throws ModelException
name
- the name of the inner classModelException
- if impossibleJDOClass[] getDeclaredClasses()
JDOField[] getDeclaredFields()
JDOField[] getDeclaredManagedFields()
PersistenceModifier.PERSISTENT
or
PersistenceModifier.TRANSACTIONAL
. The position of the fields
in the returned array equals their relative field number as returned by
JDOField.getRelativeFieldNumber()
. The following holds true for
any field in the returned array:
getDeclaredManagedFields()[i].getRelativeFieldNumber()
== i
getDeclaredManagedFields()[field.getRelativeFieldNumber()]
== field
JDOField[] getManagedFields()
PersistenceModifier.PERSISTENT
or
PersistenceModifier.TRANSACTIONAL
. The position of the fields
in the returned array equals their absolute field number as returned by
JDOField.getFieldNumber()
. The following holds true for any
field in the returned array:
getManagedFields()[i].getFieldNumber() == i
getManagedFields()[field.getFieldNumber()] == field
JDOField[] getPersistentFields()
PersistenceModifier.PERSISTENT
.
Please note, the position of the fields in the returned array might not
equal their absolute field number as returned by
JDOField.getFieldNumber()
.JDOField[] getPrimaryKeyFields()
JDOField.isPrimaryKey()
).JDOField[] getPersistentRelationshipFields()
JDOField.getRelationship()
returns
a non null value) and having the persistence-modifier
PersistenceModifier.PERSISTENT
.JDOField[] getDefaultFetchGroupFields()
JDOField.isDefaultFetchGroup()
returns true
.int[] getManagedFieldNumbers()
PersistenceModifier.PERSISTENT
or
PersistenceModifier.TRANSACTIONAL
.
Only managed fields have a valid field number, thus the field number in
the returned array equals its index:
getManagedFields()[i] == i
int[] getPersistentFieldNumbers()
PersistenceModifier.PERSISTENT
.int[] getPrimaryKeyFieldNumbers()
JDOField.isPrimaryKey()
).int[] getPersistentNonPrimaryKeyFieldNumbers()
JDOField.isPrimaryKey()
).
A field is a persistent field, if it has the persistence-modifier
PersistenceModifier.PERSISTENT
or
(see JDOField.getPersistenceModifier()
).int[] getPersistentRelationshipFieldNumbers()
JDOField.getRelationship()
returns a non null value) and has the
persistence-modifier PersistenceModifier.PERSISTENT
.int[] getPersistentSerializableFieldNumbers()
JDOField.isSerializable()
returns true
) and has the
persistence-modifier PersistenceModifier.PERSISTENT
.JDOField getManagedField(java.lang.String fieldName)
null
if the specified name does not
denote a managed field of this JDOClass. The field name may be
unqualified and or qualified (see getField(String fieldName)
).fieldName
- the name of the managed field for which field metadata
is needed.null
if there is no such field.JDOField getField(java.lang.String fieldName)
null
if the specified name does not denote a
field of this JDOClass.
The method supports lookup by unqualified and by qualified field name.
null
if the
qualifier class does not denote a valid class or if the qualifier class
is not a persistence-capable superclass of this class.
fieldName
- the unqualified or qualified name of field for which
field metadata is needed.null
if there is no such field.JDOField getField(int fieldNumber)
0 <= fieldNumber < this.getManagedFields().length
If the field number is valid the returned JDoField instance denotes a
managed field, meaning the field has the persistence-modifier
PersistenceModifier.PERSISTENT
or
PersistenceModifier.TRANSACTIONAL
. If the field number is not
valid then the method returns null
.fieldNumber
- the number for which field metadata is needed.null
if there is no such field.JDOField getDeclaredField(java.lang.String fieldName)
null
if the field name does not denote a field declared by
JDOClass.fieldName
- the unqualified name of field for which field metadata
is needed.null
if there is no such field declared by this JDOClass.int getDeclaredManagedFieldCount()
int getInheritedManagedFieldCount()
int getManagedFieldCount()
getDeclaredManagedFieldCount() +
getInheritedManagedFieldCount()
.java.lang.String getPackagePrefix()
JDOClass getPersistenceCapableRootClass()
Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.