/** Copy fields to an outside source from the key fields in the ObjectId. * This method is generated in the <code>PersistenceCapable</code> 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 * (<code>int id</code>, <code>String name</code>, and * <code>Float salary</code>) would have the method generated: * <P><code>void jdoCopyKeyFieldsFromObjectId * <BR> (PersistenceCapable oid, ObjectIdFieldConsumer fm) { * <BR> fm.storeIntField (0, oid.id); * <BR> fm.storeStringField (1, oid.name); * <BR> fm.storeObjectField (2, oid.salary); * <BR>}</code> * <P>The implementation is responsible for implementing the * <code>ObjectIdFieldConsumer</code> to store the values for the key * fields. * @param pcClass the <code>PersistenceCapable</code> class * @param oid the ObjectId source of the copy. * @param fm the field manager that receives the field values. */ public void copyKeyFieldsFromObjectId (Class pcClass, PersistenceCapable.ObjectIdFieldConsumer fm, Object oid) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); if (pcInstance == null) { throw new JDOFatalInternalException (msg.msg( "ERR_AbstractClassNoIdentity", pcClass.getName())); //NOI18N } pcInstance.jdoCopyKeyFieldsFromObjectId(fm, oid); }
/** Copy fields to an outside source from the key fields in the ObjectId. * This method is generated in the <code>PersistenceCapable</code> 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 * (<code>int id</code>, <code>String name</code>, and * <code>Float salary</code>) would have the method generated: * <P><code>void jdoCopyKeyFieldsFromObjectId * <BR> (PersistenceCapable oid, ObjectIdFieldConsumer fm) { * <BR> fm.storeIntField (0, oid.id); * <BR> fm.storeStringField (1, oid.name); * <BR> fm.storeObjectField (2, oid.salary); * <BR>}</code> * <P>The implementation is responsible for implementing the * <code>ObjectIdFieldConsumer</code> to store the values for the key * fields. * @param pcClass the <code>PersistenceCapable</code> class * @param oid the ObjectId source of the copy. * @param fm the field manager that receives the field values. */ public void copyKeyFieldsFromObjectId (Class pcClass, PersistenceCapable.ObjectIdFieldConsumer fm, Object oid) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); if (pcInstance == null) { throw new JDOFatalInternalException (msg.msg( "ERR_AbstractClassNoIdentity", pcClass.getName())); //NOI18N } pcInstance.jdoCopyKeyFieldsFromObjectId(fm, oid); }
/** Copy fields from an outside source to the key fields in the ObjectId. * This method is generated in the <code>PersistenceCapable</code> class to * generate a call to the field manager for each key field in the ObjectId. * <P>For example, an ObjectId class that has three key fields * (<code>int id</code>, <code>String name</code>, and * <code>Float salary</code>) would have the method generated: * <P><code> * void jdoCopyKeyFieldsToObjectId (Object oid, ObjectIdFieldSupplier fm) { * <BR> oid.id = fm.fetchIntField (0); * <BR> oid.name = fm.fetchStringField (1); * <BR> oid.salary = fm.fetchObjectField (2); * <BR>}</code> * <P>The implementation is responsible for implementing the * <code>ObjectIdFieldSupplier</code> to provide the values for the key * fields. * @param pcClass the <code>PersistenceCapable Class</code>. * @param oid the ObjectId target of the copy. * @param fm the field manager that supplies the field values. */ public void copyKeyFieldsToObjectId (Class pcClass, PersistenceCapable.ObjectIdFieldSupplier fm, Object oid) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); if (pcInstance == null) { throw new JDOFatalInternalException (msg.msg( "ERR_AbstractClassNoIdentity", pcClass.getName())); //NOI18N } pcInstance.jdoCopyKeyFieldsToObjectId(fm, oid); }
/** Copy fields from an outside source to the key fields in the ObjectId. * This method is generated in the <code>PersistenceCapable</code> class to * generate a call to the field manager for each key field in the ObjectId. * <P>For example, an ObjectId class that has three key fields * (<code>int id</code>, <code>String name</code>, and * <code>Float salary</code>) would have the method generated: * <P><code> * void jdoCopyKeyFieldsToObjectId (Object oid, ObjectIdFieldSupplier fm) { * <BR> oid.id = fm.fetchIntField (0); * <BR> oid.name = fm.fetchStringField (1); * <BR> oid.salary = fm.fetchObjectField (2); * <BR>}</code> * <P>The implementation is responsible for implementing the * <code>ObjectIdFieldSupplier</code> to provide the values for the key * fields. * @param pcClass the <code>PersistenceCapable Class</code>. * @param oid the ObjectId target of the copy. * @param fm the field manager that supplies the field values. */ public void copyKeyFieldsToObjectId (Class pcClass, PersistenceCapable.ObjectIdFieldSupplier fm, Object oid) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); if (pcInstance == null) { throw new JDOFatalInternalException (msg.msg( "ERR_AbstractClassNoIdentity", pcClass.getName())); //NOI18N } pcInstance.jdoCopyKeyFieldsToObjectId(fm, oid); }
PersistenceCapable pcInstance = meta.getPC(); return (pcInstance == null)?null:pcInstance.jdoNewObjectIdInstance(obj);
PersistenceCapable pcInstance = meta.getPC(); return (pcInstance == null)?null:pcInstance.jdoNewObjectIdInstance(obj);
/** Create a new instance of the class and assign its * <code>jdoStateManager</code> and key values from the ObjectId. If the * oid parameter is <code>null</code>, no key values are copied. * The new instance has its <code>jdoFlags</code> set to * <code>LOAD_REQUIRED</code>. * @see PersistenceCapable#jdoNewInstance(StateManager sm, Object oid) * @param pcClass the <code>PersistenceCapable</code> class. * @param sm the <code>StateManager</code> which will own the new instance. * @return the new instance, or <code>null</code> if the class is not * registered. * @param oid the ObjectId instance from which to copy key field values. */ public PersistenceCapable newInstance (Class pcClass, StateManager sm, Object oid) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); return pcInstance == null?null:pcInstance.jdoNewInstance(sm, oid); }
/** Create a new instance of the ObjectId class of this * <code>PersistenceCapable</code> class. * It is intended only for application identity. This method should * not be called for classes that use single field identity; * newObjectIdInstance(Class, Object) should be used instead. * If the class has been * enhanced for datastore identity, or if the class is abstract, * null is returned. * @param pcClass the <code>PersistenceCapable</code> class. * @return the new ObjectId instance, or <code>null</code> if the class * is not registered. */ public Object newObjectIdInstance (Class pcClass) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); return pcInstance == null?null:pcInstance.jdoNewObjectIdInstance(); }
/** Create a new instance of the class and assign its * <code>jdoStateManager</code> and key values from the ObjectId. If the * oid parameter is <code>null</code>, no key values are copied. * The new instance has its <code>jdoFlags</code> set to * <code>LOAD_REQUIRED</code>. * @see PersistenceCapable#jdoNewInstance(StateManager sm, Object oid) * @param pcClass the <code>PersistenceCapable</code> class. * @param sm the <code>StateManager</code> which will own the new instance. * @return the new instance, or <code>null</code> if the class is not * registered. * @param oid the ObjectId instance from which to copy key field values. */ public PersistenceCapable newInstance (Class pcClass, StateManager sm, Object oid) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); return pcInstance == null?null:pcInstance.jdoNewInstance(sm, oid); }
/** Create a new instance of the ObjectId class of this * <code>PersistenceCapable</code> class. * It is intended only for application identity. This method should * not be called for classes that use single field identity; * newObjectIdInstance(Class, Object) should be used instead. * If the class has been * enhanced for datastore identity, or if the class is abstract, * null is returned. * @param pcClass the <code>PersistenceCapable</code> class. * @return the new ObjectId instance, or <code>null</code> if the class * is not registered. */ public Object newObjectIdInstance (Class pcClass) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); return pcInstance == null?null:pcInstance.jdoNewObjectIdInstance(); }
/** Create a new instance of the class and assign its * <code>jdoStateManager</code>. The new instance has its * <code>jdoFlags</code> set to <code>LOAD_REQUIRED</code>. * @see PersistenceCapable#jdoNewInstance(StateManager sm) * @param pcClass the <code>PersistenceCapable</code> class. * @param sm the <code>StateManager</code> which will own the new instance. * @return the new instance, or <code>null</code> if the class is not * registered. */ public PersistenceCapable newInstance (Class pcClass, StateManager sm) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); return pcInstance == null?null:pcInstance.jdoNewInstance(sm); }
/** Create a new instance of the class and assign its * <code>jdoStateManager</code>. The new instance has its * <code>jdoFlags</code> set to <code>LOAD_REQUIRED</code>. * @see PersistenceCapable#jdoNewInstance(StateManager sm) * @param pcClass the <code>PersistenceCapable</code> class. * @param sm the <code>StateManager</code> which will own the new instance. * @return the new instance, or <code>null</code> if the class is not * registered. */ public PersistenceCapable newInstance (Class pcClass, StateManager sm) { Meta meta = getMeta (pcClass); PersistenceCapable pcInstance = meta.getPC(); return pcInstance == null?null:pcInstance.jdoNewInstance(sm); }