Class FieldDesc
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.model.FieldDesc
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ForeignFieldDesc,LocalFieldDesc
public abstract class FieldDesc extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description intabsoluteIDprotected ClassDescclassDescBack pointer to declaring class descriptor.intconcurrencyGroupintfetchGroupstatic intGROUP_DEFAULTstatic intGROUP_NONEprotected static LoggerloggerThe logger.protected static ResourceBundlemessagesI18N message handler.static intPROP_FOREIGN_KEY_FIELDThis field is part of a foreign key.static intPROP_IN_CONCURRENCY_CHECKThis field is used for concurrency checkstatic intPROP_LOG_ON_UPDATEUpdate before image when this field is updated.static intPROP_PRIMARY_KEY_FIELDThis field is part of a primary key.static intPROP_PRIMARY_TRACKED_FIELDThis field is the primary tracked field.static intPROP_READ_ONLYThis field is read onlystatic intPROP_RECORD_ON_UPDATERecord updates on this field to DB.static intPROP_REF_INTEGRITY_UPDATESRelationship updates are processed from the side containing this field.static intPROP_SECONDARY_TRACKED_FIELDThis field is a secondary tracked field.static intPROP_TRACK_RELATIONSHIP_FIELDThis field tracks a relationship field.static intPROP_VERSION_FIELDThis field is used for version consistency validation.intsqlProperties
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddTrackedField(FieldDesc f)ObjectconvertValue(Object value, StateManager sm)ObjectcreateSCO(Object value, StateManager sm)Creates a new SCO instance.static CharactergetCharFromString(String str)ClassgetComponentType()ClassgetDeclaringClass()intgetEnumType()StringgetName()ArrayListgetTrackedFields()ClassgetType()ObjectgetValue(StateManager sm)booleanisForeignKeyField()Returns true if this field is a foreign key field.booleanisKeyField()Returns true if this field is a primary key field.booleanisRelationshipField()Returns true if this field is a relationship field.protected voidsetupDesc(Field f)voidsetValue(StateManager sm, Object value)StringtoString()
-
-
-
Field Detail
-
GROUP_DEFAULT
public static final int GROUP_DEFAULT
- See Also:
- Constant Field Values
-
GROUP_NONE
public static final int GROUP_NONE
- See Also:
- Constant Field Values
-
PROP_IN_CONCURRENCY_CHECK
public static final int PROP_IN_CONCURRENCY_CHECK
This field is used for concurrency check- See Also:
- Constant Field Values
-
PROP_LOG_ON_UPDATE
public static final int PROP_LOG_ON_UPDATE
Update before image when this field is updated. This property is always set- See Also:
- Constant Field Values
-
PROP_READ_ONLY
public static final int PROP_READ_ONLY
This field is read only- See Also:
- Constant Field Values
-
PROP_RECORD_ON_UPDATE
public static final int PROP_RECORD_ON_UPDATE
Record updates on this field to DB. This property is always set for primitive fields.- See Also:
- Constant Field Values
-
PROP_REF_INTEGRITY_UPDATES
public static final int PROP_REF_INTEGRITY_UPDATES
Relationship updates are processed from the side containing this field.- See Also:
- Constant Field Values
-
PROP_PRIMARY_TRACKED_FIELD
public static final int PROP_PRIMARY_TRACKED_FIELD
This field is the primary tracked field.Primitive fields track each other if they are mapped to same columns. One of them is made the primary tracked field as per precedence rules on the field types. This field is used to bind values to columns while updating the database.
RESOLVE: Investigate the runtime behaviour for relationship fields marked primary.
-
PROP_SECONDARY_TRACKED_FIELD
public static final int PROP_SECONDARY_TRACKED_FIELD
This field is a secondary tracked field.Seconday tracked primitive fields are not used for updates to the database or for concurrency checking.
RESOLVE: Investigate the runtime behaviour for secondary tracked relationship fields.
-
PROP_TRACK_RELATIONSHIP_FIELD
public static final int PROP_TRACK_RELATIONSHIP_FIELD
This field tracks a relationship field. Only primitive fields can have this property set.- See Also:
- Constant Field Values
-
PROP_PRIMARY_KEY_FIELD
public static final int PROP_PRIMARY_KEY_FIELD
This field is part of a primary key.- See Also:
- Constant Field Values
-
PROP_VERSION_FIELD
public static final int PROP_VERSION_FIELD
This field is used for version consistency validation.- See Also:
- Constant Field Values
-
PROP_FOREIGN_KEY_FIELD
public static final int PROP_FOREIGN_KEY_FIELD
This field is part of a foreign key.- See Also:
- Constant Field Values
-
absoluteID
public int absoluteID
-
fetchGroup
public int fetchGroup
-
concurrencyGroup
public int concurrencyGroup
-
sqlProperties
public int sqlProperties
-
classDesc
protected final ClassDesc classDesc
Back pointer to declaring class descriptor.
-
logger
protected static final Logger logger
The logger.
-
messages
protected static final ResourceBundle messages
I18N message handler.
-
-
Method Detail
-
getComponentType
public Class getComponentType()
-
getDeclaringClass
public Class getDeclaringClass()
-
getType
public Class getType()
-
getEnumType
public int getEnumType()
-
getName
public String getName()
-
getValue
public Object getValue(StateManager sm)
-
setValue
public void setValue(StateManager sm, Object value)
-
getTrackedFields
public ArrayList getTrackedFields()
-
isKeyField
public boolean isKeyField()
Returns true if this field is a primary key field.
-
isForeignKeyField
public boolean isForeignKeyField()
Returns true if this field is a foreign key field.
-
isRelationshipField
public boolean isRelationshipField()
Returns true if this field is a relationship field.
-
convertValue
public Object convertValue(Object value, StateManager sm)
-
createSCO
public Object createSCO(Object value, StateManager sm)
Creates a new SCO instance. Therefore checks if PersistenceManager settings require SCO creation. SCOs will typically be created in a non managed environment.- Parameters:
value- Value being converted.sm- StateManager of the persistent object being bound.- Returns:
- New SCO instance according to
enumFieldTypeof this field. Returns null if no SCO was created.
-
setupDesc
protected void setupDesc(Field f)
-
addTrackedField
protected void addTrackedField(FieldDesc f)
-
-