Home » JDO » JDOImplHelper » copyKeyFieldsFromObjectId(pcClass, fm, oid) - JDO JDOImplHelper's method

copyKeyFieldsFromObjectId(pcClass, fm, oid) - JDO JDOImplHelper's method

Method
javax.jdo.spi.JDOImplHelper
void copyKeyFieldsFromObjectId(
  Class pcClass,
  ObjectIdFieldConsumer fm,
  Object oid
)

Copy fields to an outside source from the key fields in the ObjectId. This method is generated in the PersistenceCapable class to generate a call to the field manager for each key field in the ObjectId. For example, an ObjectId class that has three key fields ( int id, String name, and Float salary) would have the method generated:

void jdoCopyKeyFieldsFromObjectId
(PersistenceCapable oid, ObjectIdFieldConsumer fm) {
fm.storeIntField (0, oid.id);
fm.storeStringField (1, oid.name);
fm.storeObjectField (2, oid.salary);
}

The implementation is responsible for implementing the ObjectIdFieldConsumer to store the values for the key fields.

Parameters:
pcClass - the PersistenceCapable class
fm - the field manager that receives the field values.
oid - the ObjectId source of the copy.
Since:
JDO 1.0

This documentation page is derived (with some adjustments) from the JDO 2.2 API
and is available under the terms of the Apache License, v. 2.0.