Class UpdateObjectDescImpl
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.sql.UpdateObjectDescImpl
-
- All Implemented Interfaces:
ActionDesc
,UpdateObjectDesc
public class UpdateObjectDescImpl extends Object implements UpdateObjectDesc
Stores the update information for the associated state manager.
-
-
Field Summary
-
Fields inherited from interface com.sun.jdo.spi.persistence.support.sqlstore.ActionDesc
LOG_CREATE, LOG_DESTROY, LOG_NOOP, LOG_UPDATE, OP_ABS, OP_ADD, OP_AND, OP_APPROX, OP_AVG, OP_BETWEEN, OP_CONCAT, OP_COUNT, OP_COUNT_PC, OP_DISTINCT, OP_DIV, OP_EQ, OP_EQ_CLASS, OP_EQUIJOIN, OP_EXISTS, OP_FIELD, OP_FOR_UPDATE, OP_GE, OP_GT, OP_IN, OP_LE, OP_LEFTJOIN, OP_LENGTH, OP_LENGTHB, OP_LIKE, OP_LIKE_ESCAPE, OP_LOWER, OP_LT, OP_LTRIM, OP_MAX, OP_MAX_ROWS, OP_MAYBE_NULL, OP_MIN, OP_MOD, OP_MUL, OP_NE, OP_NONKEY, OP_NONREL_JOIN, OP_NOT, OP_NOTEXISTS, OP_NOTIN, OP_NOTNULL, OP_NULL, OP_NULL_COMPARISION_FUNCTION, OP_OR, OP_ORDERBY, OP_ORDERBY_DESC, OP_PARAMETER, OP_PARAMETER_COUNT, OP_POSITION, OP_POSITION_START, OP_RIGHTJOIN, OP_RTRIM, OP_RTRIMFIXED, OP_SOUNDEX, OP_SQRT, OP_SUB, OP_SUBSTR, OP_SUBSTRB, OP_SUBSTRING, OP_SUM, OP_UPPER, OP_VALUE
-
-
Constructor Summary
Constructors Constructor Description UpdateObjectDescImpl(Class pcClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearUpdatedJoinTableRelationships()
SQLStateManager
getAfterImage()
Object
getAfterValue(FieldDesc f)
Object
getBeforeValue(FieldDesc f)
Concurrency
getConcurrency()
ClassDesc
getConfig()
Class
getPersistenceCapableClass()
int
getUpdateAction()
List
getUpdatedFields()
Collection
getUpdatedJoinTableFields()
Collection
getUpdateJoinTableDescs(FieldDesc fieldDesc)
boolean
hasChangedRelationships()
Returnstrue
, if this state manager has a changed relationship field.boolean
hasModifiedLobField()
Returnstrue
if any of the changed fields is byte[].boolean
hasUpdatedFields()
boolean
hasUpdatedJoinTableRelationships()
boolean
hasVersionConsistency()
void
incrementVersion()
Triggers the version update if the associated state manager is registered for version consistency and database fields have been modified.boolean
isBeforeImageRequired()
void
markRelationshipChange(FieldDesc fieldDesc)
Marks the relationship change property for this instance, if the updated field is a relationship field or a hidden field tracing a foreign key column in the database.void
recordUpdatedField(LocalFieldDesc fieldDesc)
void
recordUpdatedJoinTableRelationship(ForeignFieldDesc fieldDesc, SQLStateManager parentSM, SQLStateManager foreignSM, int action)
Schedules a jointable entry for relationship fieldfieldDesc
.boolean
removeUpdatedJoinTableRelationship(ForeignFieldDesc fieldDesc, SQLStateManager foreignSM, int action)
Removes a previously scheduled jointable entry for relationship fieldfieldDesc
.void
reset()
void
setConcurrency(Concurrency concurrency)
void
setObjectInfo(StateManager biStateManager, StateManager aiStateManager, int action)
We send the AfterImage for updates and inserts but for updates it will only hold values for updated attributes (unless the class is configured to send the whole AfterImage, also we'll let the concurrency interface affect the sent AfterImage (and the sent BeforeImage)).void
setVerificationFailed()
Marks the associated state manager as failed.
-
-
-
Constructor Detail
-
UpdateObjectDescImpl
public UpdateObjectDescImpl(Class pcClass)
-
-
Method Detail
-
getPersistenceCapableClass
public Class getPersistenceCapableClass()
- Specified by:
getPersistenceCapableClass
in interfaceActionDesc
-
reset
public void reset()
-
hasUpdatedFields
public boolean hasUpdatedFields()
-
getUpdatedJoinTableFields
public Collection getUpdatedJoinTableFields()
-
getUpdateJoinTableDescs
public Collection getUpdateJoinTableDescs(FieldDesc fieldDesc)
-
hasUpdatedJoinTableRelationships
public boolean hasUpdatedJoinTableRelationships()
-
hasModifiedLobField
public boolean hasModifiedLobField()
Returnstrue
if any of the changed fields is byte[].
-
markRelationshipChange
public void markRelationshipChange(FieldDesc fieldDesc)
Marks the relationship change property for this instance, if the updated field is a relationship field or a hidden field tracing a foreign key column in the database.- Parameters:
fieldDesc
- Updated field.
-
hasChangedRelationships
public boolean hasChangedRelationships()
Returnstrue
, if this state manager has a changed relationship field.- Returns:
- True, if this state manager has a changed relationship field.
-
removeUpdatedJoinTableRelationship
public boolean removeUpdatedJoinTableRelationship(ForeignFieldDesc fieldDesc, SQLStateManager foreignSM, int action)
Removes a previously scheduled jointable entry for relationship fieldfieldDesc
. Theaction
parameter specifies, if the entry to be removed is scheduled for creation or removal.- Parameters:
fieldDesc
- Updated relationship field.foreignSM
- Associated state manager on the opposite side.action
- The action is either CREATE or REMOVE.- Returns:
- True, if the specified jointable entry was found and removed, false otherwise.
- See Also:
recordUpdatedJoinTableRelationship(com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc, com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager, com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager, int)
-
recordUpdatedJoinTableRelationship
public void recordUpdatedJoinTableRelationship(ForeignFieldDesc fieldDesc, SQLStateManager parentSM, SQLStateManager foreignSM, int action)
Schedules a jointable entry for relationship fieldfieldDesc
. The scheduled jointable entry is uniquely identified by the relationship field and the two associated state managers. Theaction
parameter specifies, if the jointable entry should be created or removed.- Parameters:
fieldDesc
- Updated relationship field.parentSM
- State manager responsible forfieldDesc
's defining class.foreignSM
- State manager responsible for the other side.action
- The action is either CREATE or REMOVE.- See Also:
removeUpdatedJoinTableRelationship(com.sun.jdo.spi.persistence.support.sqlstore.model.ForeignFieldDesc, com.sun.jdo.spi.persistence.support.sqlstore.SQLStateManager, int)
-
clearUpdatedJoinTableRelationships
public void clearUpdatedJoinTableRelationships()
-
recordUpdatedField
public void recordUpdatedField(LocalFieldDesc fieldDesc)
-
getUpdatedFields
public List getUpdatedFields()
-
getUpdateAction
public int getUpdateAction()
-
getConfig
public ClassDesc getConfig()
-
getAfterImage
public SQLStateManager getAfterImage()
-
isBeforeImageRequired
public boolean isBeforeImageRequired()
-
getConcurrency
public Concurrency getConcurrency()
-
setConcurrency
public void setConcurrency(Concurrency concurrency)
-
setObjectInfo
public void setObjectInfo(StateManager biStateManager, StateManager aiStateManager, int action)
We send the AfterImage for updates and inserts but for updates it will only hold values for updated attributes (unless the class is configured to send the whole AfterImage, also we'll let the concurrency interface affect the sent AfterImage (and the sent BeforeImage)). For deletes the AfterImage will be NIL, for inserts the BeforeImage will be NIL. For deletes the BeforeImage will contain values for all key attributes. Also for deletes and updates we'll send the HiddenValues array from the paladin (although we can set to NIL any values in the array not needed by this particular update). UpdatedAttributes will contain indexes into the PersistentDesc.Attributes array for new or updated values. Initially we'll probably just send the whole BeforeImage and AfterImage (except that we won't have an AfterImage for Deletes and we won't have a BeforeImage for updates).- Specified by:
setObjectInfo
in interfaceUpdateObjectDesc
-
incrementVersion
public void incrementVersion()
Triggers the version update if the associated state manager is registered for version consistency and database fields have been modified. The version is incremented, if- The associated instance is version consistent.
- The associated instance has updated database fields.
-
setVerificationFailed
public void setVerificationFailed()
Marks the associated state manager as failed.
-
hasVersionConsistency
public boolean hasVersionConsistency()
-
-