|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.model.jdo.JDOElementImpl
org.apache.jdo.impl.model.jdo.JDOMemberImpl
org.apache.jdo.impl.model.jdo.JDOAssociatedPropertyImplDynamic
public class JDOAssociatedPropertyImplDynamic
An instance of this class represents the JDO metadata of a managed property of a persistence capable class. This JDOProperty implementation is used for persistent properties with an associated JDOField. All JDOField getter methods delegate to the associated JDOField, except methods getName, getDeclaringClass and getJavaField. All JDOField setter method throw a ModelException to avoid changing the associated JDOField through this JDOProperty instance. This dynamic implementation only stores values explicitly set by setter method.
Field Summary | |
---|---|
protected JavaProperty |
javaProperty
The corresponding JavaProperty instance. |
protected static I18NHelper |
msg
I18N support. |
Constructor Summary | |
---|---|
protected |
JDOAssociatedPropertyImplDynamic(java.lang.String name,
JDOClass declaringClass,
JDOField associatedJDOField)
Constrcutor. |
Method Summary | |
---|---|
JDOArray |
createJDOArray()
Throws ModelException. |
JDOCollection |
createJDOCollection()
Throws ModelException. |
JDOMap |
createJDOMap()
Throws ModelException. |
JDOReference |
createJDOReference()
Throws ModelException. |
JDOField |
getAssociatedJDOField()
Return the JDOField instance associated with this property, if available. |
int |
getFieldNumber()
Deletegate to associatedJDOField. |
JavaField |
getJavaField()
Get the corresponding JavaProperty representation for this JDOProperty. |
java.lang.String |
getMappedByName()
Deletegate to associatedJDOField. |
int |
getNullValueTreatment()
Deletegate to associatedJDOField. |
int |
getPersistenceModifier()
Deletegate to associatedJDOField. |
JDORelationship |
getRelationship()
Deletegate to associatedJDOField. |
int |
getRelativeFieldNumber()
Deletegate to associatedJDOField. |
JavaType |
getType()
Deletegate to associatedJDOField. |
boolean |
isDefaultFetchGroup()
Deletegate to associatedJDOField. |
boolean |
isEmbedded()
Deletegate to associatedJDOField. |
boolean |
isManaged()
Deletegate to associatedJDOField. |
boolean |
isPersistent()
Deletegate to associatedJDOField. |
boolean |
isPrimaryKey()
Deletegate to associatedJDOField. |
boolean |
isProperty()
Convenience method to check whether this field represents a property. |
boolean |
isRelationship()
Deletegate to associatedJDOField. |
boolean |
isSerializable()
Deletegate to associatedJDOField. |
boolean |
isTransactional()
Deletegate to associatedJDOField. |
void |
setDefaultFetchGroup(boolean defaultFetchGroup)
Throws ModelException. |
void |
setEmbedded(boolean embedded)
Throws ModelException. |
void |
setJavaField(JavaField javaField)
Sets the corresponding JavaProperty representation for this JDOProperty. |
void |
setMappedByName(java.lang.String mappedByName)
Throws ModelException. |
void |
setNullValueTreatment(int nullValueTreament)
Throws ModelException. |
void |
setPersistenceModifier(int persistenceModifier)
Throws ModelException. |
void |
setPrimaryKey(boolean primaryKey)
Throws ModelException. |
void |
setRelationship(JDORelationship relationship)
Throws ModelException. |
void |
setSerializable(boolean serializable)
Throws ModelException. |
Methods inherited from class org.apache.jdo.impl.model.jdo.JDOMemberImpl |
---|
compareTo, equals, getDeclaringClass, getName, hashCode, toString |
Methods inherited from class org.apache.jdo.impl.model.jdo.JDOElementImpl |
---|
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, firePropertyChange, fireVetoableChange, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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 |
Field Detail |
---|
protected JavaProperty javaProperty
protected static final I18NHelper msg
Constructor Detail |
---|
protected JDOAssociatedPropertyImplDynamic(java.lang.String name, JDOClass declaringClass, JDOField associatedJDOField) throws ModelException
ModelException
Method Detail |
---|
public JavaField getJavaField()
getJavaField
in interface JDOField
public void setJavaField(JavaField javaField) throws ModelException
setJavaField
in interface JDOField
javaField
- the corresponding JavaProperty representation
ModelException
- if impossiblepublic boolean isProperty()
isProperty
in interface JDOField
true
if this field represents a property;
false
otherwisepublic int getPersistenceModifier()
getPersistenceModifier
in interface JDOField
PersistenceModifier.UNSPECIFIED
,
PersistenceModifier.NONE
,
PersistenceModifier.PERSISTENT
,
PersistenceModifier.TRANSACTIONAL
,
PersistenceModifier.POSSIBLY_PERSISTENT
.public void setPersistenceModifier(int persistenceModifier) throws ModelException
setPersistenceModifier
in interface JDOField
persistenceModifier
- an integer indicating the persistence
modifier, one of: PersistenceModifier.UNSPECIFIED
,
PersistenceModifier.NONE
,
PersistenceModifier.PERSISTENT
,
PersistenceModifier.TRANSACTIONAL
,
PersistenceModifier.POSSIBLY_PERSISTENT
.
ModelException
- if impossiblepublic boolean isPrimaryKey()
isPrimaryKey
in interface JDOField
true
if the field is a key field,
false
otherwisepublic void setPrimaryKey(boolean primaryKey) throws ModelException
setPrimaryKey
in interface JDOField
primaryKey
- if true
, the JDOField is marked
as a key field; otherwise, it is not
ModelException
- if impossiblepublic int getNullValueTreatment()
getNullValueTreatment
in interface JDOField
NullValueTreatment.NONE
, NullValueTreatment.EXCEPTION
or
NullValueTreatment.DEFAULT
public void setNullValueTreatment(int nullValueTreament) throws ModelException
setNullValueTreatment
in interface JDOField
nullValueTreament
- an integer indicating the null value treatment,
one of: NullValueTreatment.NONE
,
NullValueTreatment.EXCEPTION
or
NullValueTreatment.DEFAULT
ModelException
- if impossiblepublic boolean isDefaultFetchGroup()
isDefaultFetchGroup
in interface JDOField
true
if the field is part of the default fetch
group, false
otherwisepublic void setDefaultFetchGroup(boolean defaultFetchGroup) throws ModelException
setDefaultFetchGroup
in interface JDOField
defaultFetchGroup
- if true
, the JDOField is marked
as beeing part of the default fetch group; otherwise, it is not
ModelException
- if impossiblepublic boolean isEmbedded()
isEmbedded
in interface JDOField
true
if the field is stored as part of the instance;
false
otherwisepublic void setEmbedded(boolean embedded) throws ModelException
setEmbedded
in interface JDOField
embedded
- true
if the field is stored as part of the
instance; false
otherwise
ModelException
- if impossiblepublic boolean isSerializable()
isSerializable
in interface JDOField
true
if the field is serializable,
false
otherwisepublic void setSerializable(boolean serializable) throws ModelException
setSerializable
in interface JDOField
serializable
- if true
, the JDOField is serializable;
otherwise, it is not
ModelException
- if impossiblepublic java.lang.String getMappedByName()
getMappedByName
in interface JDOField
null
otherwise.public void setMappedByName(java.lang.String mappedByName) throws ModelException
setMappedByName
in interface JDOField
mappedByName
- the mappedBy field name.
ModelException
- if impossiblepublic JDORelationship getRelationship()
getRelationship
in interface JDOField
null
if
this JDOField is not a relationshippublic void setRelationship(JDORelationship relationship) throws ModelException
setRelationship
in interface JDOField
relationship
- the JDORelationship instance
ModelException
- if impossiblepublic JDOReference createJDOReference() throws ModelException
createJDOReference
in interface JDOField
ModelException
- if impossiblepublic JDOCollection createJDOCollection() throws ModelException
createJDOCollection
in interface JDOField
ModelException
- if impossiblepublic JDOArray createJDOArray() throws ModelException
createJDOArray
in interface JDOField
ModelException
- if impossiblepublic JDOMap createJDOMap() throws ModelException
createJDOMap
in interface JDOField
ModelException
- if impossiblepublic boolean isPersistent()
isPersistent
in interface JDOField
true
if this field has the
PersistenceModifier.PERSISTENT
modifier; false
otherwisepublic boolean isTransactional()
isTransactional
in interface JDOField
true
if this field has the
PersistenceModifier.TRANSACTIONAL
modifier; false
otherwisepublic boolean isManaged()
isManaged
in interface JDOField
true
if this field is a managed field;
false
otherwisepublic boolean isRelationship()
isRelationship
in interface JDOField
true
if this field is a relationship;
false
otherwisepublic JavaType getType()
getType
in interface JDOField
public int getFieldNumber()
getFieldNumber
in interface JDOField
public int getRelativeFieldNumber()
getRelativeFieldNumber
in interface JDOField
public JDOField getAssociatedJDOField()
null
.
getAssociatedJDOField
in interface JDOProperty
null
if not
available.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |