getBooleanField
public boolean getBooleanField(PersistenceCapable pc,
int field,
boolean currentValue)
Return the value for the field.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
- the new value for the field
getByteField
public byte getByteField(PersistenceCapable pc,
int field,
byte currentValue)
Return the value for the field.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
- the new value for the field
getCharField
public char getCharField(PersistenceCapable pc,
int field,
char currentValue)
Return the value for the field.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
- the new value for the field
getDoubleField
public double getDoubleField(PersistenceCapable pc,
int field,
double currentValue)
Return the value for the field.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
- the new value for the field
getFloatField
public float getFloatField(PersistenceCapable pc,
int field,
float currentValue)
Return the value for the field.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
- the new value for the field
getIntField
public int getIntField(PersistenceCapable pc,
int field,
int currentValue)
Return the value for the field.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
- the new value for the field
getLongField
public long getLongField(PersistenceCapable pc,
int field,
long currentValue)
Return the value for the field.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
- the new value for the field
getObjectField
public Object getObjectField(PersistenceCapable pc,
int field,
Object currentValue)
Return the value for the field.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
- the new value for the field
getObjectId
public Object getObjectId(PersistenceCapable pc)
Return the object representing the JDO identity
of the calling instance. If the JDO identity is being changed in
the current transaction, this method returns the identity as of
the beginning of the transaction.
pc
- the calling PersistenceCapable
instance
- the object representing the JDO identity of the calling instance
getPersistenceManager
public PersistenceManager getPersistenceManager(PersistenceCapable pc)
Return the PersistenceManager
that owns this instance.
pc
- the calling PersistenceCapable
instance
- the
PersistenceManager
that owns this instance
getShortField
public short getShortField(PersistenceCapable pc,
int field,
short currentValue)
Return the value for the field.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
- the new value for the field
getStringField
public String getStringField(PersistenceCapable pc,
int field,
String currentValue)
Return the value for the field.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
- the new value for the field
getTransactionalObjectId
public Object getTransactionalObjectId(PersistenceCapable pc)
Return the object representing the JDO identity
of the calling instance. If the JDO identity is being changed in
the current transaction, this method returns the current identity as
changed in the transaction.
pc
- the calling PersistenceCapable
instance
- the object representing the JDO identity of the calling instance
getVersion
public Object getVersion(PersistenceCapable pc)
Return the object representing the version
of the calling instance.
pc
- the calling PersistenceCapable
instance
- the object representing the version of the calling instance
isDeleted
public boolean isDeleted(PersistenceCapable pc)
Tests whether this object has been deleted.
Instances that have been deleted in the current transaction return
true
.
Transient instances return
false
.
pc
- the calling PersistenceCapable
instance
true
if this instance was deleted
in the current transaction.
PersistenceManager.deletePersistent(Object pc)
isDirty
public boolean isDirty(PersistenceCapable pc)
Tests whether this object is dirty.
Instances that have been modified, deleted, or newly
made persistent in the current transaction return
true
.
Transient nontransactional instances return
false
.
pc
- the calling PersistenceCapable
instance
true
if this instance has been modified in the
current transaction.
PersistenceCapable.jdoMakeDirty(String fieldName)
isLoaded
public boolean isLoaded(PersistenceCapable pc,
int field)
Return true
if the field is cached in the calling
instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- whether the field is cached in the calling instance
isNew
public boolean isNew(PersistenceCapable pc)
Tests whether this object has been newly made persistent.
Instances that have been made persistent in the current transaction
return
true
.
Transient instances return
false
.
pc
- the calling PersistenceCapable
instance
true
if this instance was made persistent
in the current transaction.
PersistenceManager.makePersistent(Object pc)
isPersistent
public boolean isPersistent(PersistenceCapable pc)
Tests whether this object is persistent.
Instances whose state is stored in the data store return
true
.
Transient instances return
false
.
pc
- the calling PersistenceCapable
instance
true
if this instance is persistent.
PersistenceManager.makePersistent(Object pc)
isTransactional
public boolean isTransactional(PersistenceCapable pc)
Tests whether this object is transactional.
Instances that respect transaction boundaries return
true
.
These instances include transient instances made transactional as a
result of being the target of a
makeTransactional
method
call; newly made persistent or deleted persistent instances; persistent
instances read in data store transactions; and persistent instances
modified in optimistic transactions.
Transient nontransactional instances return
false
.
pc
- the calling PersistenceCapable
instance
true
if this instance is transactional.
makeDirty
public void makeDirty(PersistenceCapable pc,
String fieldName)
Mark the associated
PersistenceCapable
field dirty.
The
StateManager
will make a copy of the field
so it can be restored if needed later, and then mark
the field as modified in the current transaction.
pc
- the calling PersistenceCapable
instancefieldName
- the name of the field
preSerialize
public void preSerialize(PersistenceCapable pc)
Guarantee that the serializable transactional and persistent fields
are loaded into the instance. This method is called by the generated
jdoPreSerialize
method prior to serialization of the
instance.
pc
- the calling PersistenceCapable
instance
providedBooleanField
public void providedBooleanField(PersistenceCapable pc,
int field,
boolean currentValue)
The value of the field requested to be provided to the
StateManager
.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
providedByteField
public void providedByteField(PersistenceCapable pc,
int field,
byte currentValue)
The value of the field requested to be provided to the
StateManager
.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
providedCharField
public void providedCharField(PersistenceCapable pc,
int field,
char currentValue)
The value of the field requested to be provided to the
StateManager
.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
providedDoubleField
public void providedDoubleField(PersistenceCapable pc,
int field,
double currentValue)
The value of the field requested to be provided to the
StateManager
.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
providedFloatField
public void providedFloatField(PersistenceCapable pc,
int field,
float currentValue)
The value of the field requested to be provided to the
StateManager
.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
providedIntField
public void providedIntField(PersistenceCapable pc,
int field,
int currentValue)
The value of the field requested to be provided to the
StateManager
.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
providedLongField
public void providedLongField(PersistenceCapable pc,
int field,
long currentValue)
The value of the field requested to be provided to the
StateManager
.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
providedObjectField
public void providedObjectField(PersistenceCapable pc,
int field,
Object currentValue)
The value of the field requested to be provided to the
StateManager
.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
providedShortField
public void providedShortField(PersistenceCapable pc,
int field,
short currentValue)
The value of the field requested to be provided to the
StateManager
.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
providedStringField
public void providedStringField(PersistenceCapable pc,
int field,
String currentValue)
The value of the field requested to be provided to the
StateManager
.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the field
replacingBooleanField
public boolean replacingBooleanField(PersistenceCapable pc,
int field)
The replacement value of the field in the calling instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- the new value for the field
replacingByteField
public byte replacingByteField(PersistenceCapable pc,
int field)
The replacement value of the field in the calling instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- the new value for the field
replacingCharField
public char replacingCharField(PersistenceCapable pc,
int field)
The replacement value of the field in the calling instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- the new value for the field
replacingDetachedState
public Object[] replacingDetachedState(Detachable pc,
Object[] state)
The replacement value of the detached state in the calling instance.
pc
- the calling Detachable
instancestate
- the current value of the detached state
- the replacement value for the detached state
replacingDoubleField
public double replacingDoubleField(PersistenceCapable pc,
int field)
The replacement value of the field in the calling instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- the new value for the field
replacingFlags
public byte replacingFlags(PersistenceCapable pc)
The owning StateManager
uses this method to supply the
value of the flags to the PersistenceCapable
instance.
pc
- the calling PersistenceCapable
instance
- the value of
jdoFlags
to be stored in the
PersistenceCapable
instance
replacingFloatField
public float replacingFloatField(PersistenceCapable pc,
int field)
The replacement value of the field in the calling instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- the new value for the field
replacingIntField
public int replacingIntField(PersistenceCapable pc,
int field)
The replacement value of the field in the calling instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- the new value for the field
replacingLongField
public long replacingLongField(PersistenceCapable pc,
int field)
The replacement value of the field in the calling instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- the new value for the field
replacingObjectField
public Object replacingObjectField(PersistenceCapable pc,
int field)
The replacement value of the field in the calling instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- the new value for the field
replacingShortField
public short replacingShortField(PersistenceCapable pc,
int field)
The replacement value of the field in the calling instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- the new value for the field
replacingStateManager
public StateManager replacingStateManager(PersistenceCapable pc,
StateManager sm)
Replace the current value of
jdoStateManager
.
This method is called by the
PersistenceCapable
whenever
jdoReplaceStateManager
is called and there is already
an owning
StateManager
. This is a security precaution
to ensure that the owning
StateManager
is the only
source of any change to its reference in the
PersistenceCapable
.
pc
- the calling PersistenceCapable
instancesm
- the proposed new value for the jdoStateManager
- the new value for the
jdoStateManager
replacingStringField
public String replacingStringField(PersistenceCapable pc,
int field)
The replacement value of the field in the calling instance.
pc
- the calling PersistenceCapable
instancefield
- the field number
- the new value for the field
setBooleanField
public void setBooleanField(PersistenceCapable pc,
int field,
boolean currentValue,
boolean newValue)
Mark the field as modified by the user.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the proposed new value of the field
setByteField
public void setByteField(PersistenceCapable pc,
int field,
byte currentValue,
byte newValue)
Mark the field as modified by the user.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the proposed new value of the field
setCharField
public void setCharField(PersistenceCapable pc,
int field,
char currentValue,
char newValue)
Mark the field as modified by the user.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the proposed new value of the field
setDoubleField
public void setDoubleField(PersistenceCapable pc,
int field,
double currentValue,
double newValue)
Mark the field as modified by the user.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the proposed new value of the field
setFloatField
public void setFloatField(PersistenceCapable pc,
int field,
float currentValue,
float newValue)
Mark the field as modified by the user.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the proposed new value of the field
setIntField
public void setIntField(PersistenceCapable pc,
int field,
int currentValue,
int newValue)
Mark the field as modified by the user.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the proposed new value of the field
setLongField
public void setLongField(PersistenceCapable pc,
int field,
long currentValue,
long newValue)
Mark the field as modified by the user.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the proposed new value of the field
setObjectField
public void setObjectField(PersistenceCapable pc,
int field,
Object currentValue,
Object newValue)
Mark the field as modified by the user.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the proposed new value of the field
setShortField
public void setShortField(PersistenceCapable pc,
int field,
short currentValue,
short newValue)
Mark the field as modified by the user.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the proposed new value of the field
setStringField
public void setStringField(PersistenceCapable pc,
int field,
String currentValue,
String newValue)
Mark the field as modified by the user.
pc
- the calling PersistenceCapable
instancefield
- the field numbercurrentValue
- the current value of the fieldnewValue
- the proposed new value of the field