|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A JDOClass instance represents the JDO metadata of a persistence-capable class.
Method Summary | |
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. |
JDOProperty |
createJDOProperty(java.lang.String name)
This method returns a JDOProperty instance for the property with the specified name. |
JDOProperty |
createJDOProperty(java.lang.String name,
JDOField associatedField)
This method returns a JDOProperty instance for the property with the specified name and associated field. |
JDOProperty |
getAssociatedProperty(JDOField field)
Returns JDOProperty metadata for a property having the specified JDOField as associated JDOField. |
JDOProperty |
getAssociatedProperty(java.lang.String name)
Returns JDOProperty metadata for a property with the specified name having an associated JDOField. |
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. |
java.lang.String |
getShortName()
Get the short name of this JDOClass. |
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 |
setShortName(java.lang.String shortName)
Set the short name of this JDOClass. |
void |
setXMLMetadataLoaded()
Sets the flag indicating that the class XML metadata for this JDOClass is loaded to true . |
Methods inherited from interface org.apache.jdo.model.jdo.JDOMember |
getDeclaringClass, getName |
Methods inherited from interface org.apache.jdo.model.jdo.JDOElement |
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener |
Methods inherited from interface java.lang.Comparable |
compareTo |
Method Detail |
public java.lang.String getShortName()
setShortName(String shortName)
.
public void setShortName(java.lang.String shortName) throws ModelException
shortName
- the short name.
ModelException
- if impossiblepublic int getIdentityType()
JDOIdentityType.APPLICATION
if objectid-class is
specified, and JDOIdentityType.DATASTORE
, if not.
JDOIdentityType.APPLICATION
,
JDOIdentityType.DATASTORE
, or
JDOIdentityType.NONDURABLE
public 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 impossiblepublic JavaType getObjectIdClass()
public void setObjectIdClass(JavaType objectIdClass) throws ModelException
objectIdClass
- the JavaType representation of the
object identity class.
ModelException
- if impossiblepublic java.lang.String getDeclaredObjectIdClassName()
null
. This is different from method
getObjectIdClass()
which returns a non-null value, if the
superclass defines a objectIdClass.
public void setDeclaredObjectIdClassName(java.lang.String declaredObjectIdClassName) throws ModelException
declaredObjectIdClassName
- the name of the object identity class
ModelException
- if impossiblepublic boolean requiresExtent()
true if this class must manage an extent;
false
otherwise
public void setRequiresExtent(boolean requiresExtent) throws ModelException
requiresExtent
- true
if this class must manage
an extent; false
otherwise
ModelException
- if impossiblepublic java.lang.String getPersistenceCapableSuperclassName()
null
is returned.
null
if there is no persistence-capable superclasspublic void setPersistenceCapableSuperclassName(java.lang.String pcSuperclassName) throws ModelException
pcSuperclassName
- the fully qualified name of the
persistence-capable superclass
ModelException
- if impossiblepublic JavaType 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.
public void setJavaType(JavaType javaType) throws ModelException
javaType
- the JavaType representation for this JDOClass.
ModelException
- if impossiblepublic boolean isXMLMetadataLoaded()
true
if XML metadata is loaded;
false
otherwisepublic void setXMLMetadataLoaded()
true
.
public void removeDeclaredMember(JDOMember member) throws ModelException
member
- the member to be removed
ModelException
- if impossiblepublic JDOMember[] getDeclaredMembers()
public JDOModel getDeclaringModel()
public void setDeclaringModel(JDOModel model)
model
- the declaring JDOModel of this JDOClasspublic JDOClass getPersistenceCapableSuperclass()
null
is returned.
null
if there is no persistence-capable superclasspublic void setPersistenceCapableSuperclass(JDOClass pcSuperclass) throws ModelException
pcSuperclass
- the JDClass instance of the persistence-capable
superclass
ModelException
- if impossiblepublic JDOPackage getJDOPackage()
public void setJDOPackage(JDOPackage jdoPackage)
jdoPackage
- the JDOPackage of this JDOClass.public JDOField createJDOField(java.lang.String name) throws ModelException
name
- the name of the field
ModelException
- if impossiblepublic JDOProperty createJDOProperty(java.lang.String name) throws ModelException
name
- the name of the property
ModelException
- if impossiblepublic JDOProperty createJDOProperty(java.lang.String name, JDOField associatedField) throws ModelException
name
- the name of the propertyassociatedField
- the associated JDOField
ModelException
- if impossiblepublic JDOClass createJDOClass(java.lang.String name) throws ModelException
name
- the name of the inner class
ModelException
- if impossiblepublic JDOClass[] getDeclaredClasses()
public JDOField[] getDeclaredFields()
public 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
public 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
public 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()
.
public JDOField[] getPrimaryKeyFields()
JDOField.isPrimaryKey()
).
public JDOField[] getPersistentRelationshipFields()
JDOField.getRelationship()
returns
a non null value) and having the persistence-modifier
PersistenceModifier.PERSISTENT
.
public JDOField[] getDefaultFetchGroupFields()
JDOField.isDefaultFetchGroup()
returns true
.
public 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
public int[] getPersistentFieldNumbers()
PersistenceModifier.PERSISTENT
.
public int[] getPrimaryKeyFieldNumbers()
JDOField.isPrimaryKey()
).
public int[] getPersistentNonPrimaryKeyFieldNumbers()
JDOField.isPrimaryKey()
).
A field is a persistent field, if it has the persistence-modifier
PersistenceModifier.PERSISTENT
or
(see JDOField.getPersistenceModifier()
).
public int[] getPersistentRelationshipFieldNumbers()
JDOField.getRelationship()
returns a non null value) and has the
persistence-modifier PersistenceModifier.PERSISTENT
.
public int[] getPersistentSerializableFieldNumbers()
JDOField.isSerializable()
returns true
) and has the
persistence-modifier PersistenceModifier.PERSISTENT
.
public 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.public 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.public 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.public 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.public JDOProperty getAssociatedProperty(java.lang.String name)
null
, if
the name does not denote a property with an associated JDOField of this
JDOClass. Please note, the method does not check for properties without
an associated JDOField. It will return null
if there is
a property with the specified name, but this property does not have an
associated JDOField.
name
- the name of property with an associated JDOField for which
metadata is needed.
null
if there is no such property.public JDOProperty getAssociatedProperty(JDOField field)
null
,
if this JDOClass does not have a property with the specified JDOField
as associated JDOField.
null
if there is no such property.public int getDeclaredManagedFieldCount()
public int getInheritedManagedFieldCount()
public int getManagedFieldCount()
getDeclaredManagedFieldCount() +
getInheritedManagedFieldCount()
.
public java.lang.String getPackagePrefix()
public JDOClass getPersistenceCapableRootClass()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |