7 | of a persistent object can be done as follows: Object oid = pm.getObjectId(obj); Or by a static method (useful when a PersistenceManager is unavailable): Object oid = JDOHelper.getObjectId(obj); JDO does ... ().begin(); Person person = new Person("George", "Bush"); pm.makePersistent(person); Object oid = pm |
7 | Method javax.jdo.PersistenceManager Object getObjectById( Object oid, boolean validate ... . The oid parameter object might have been returned by an earlier call to getObjectId or ... to resolve the oid parameter to an ObjectId instance, then it throws a JDOUserException. If the validate |
7 | , Object oid ) Copy fields to an outside consumer from the key fields in the ObjectId. This method ... (ObjectIdFieldConsumer fm, Object objectId) { EmployeeKey oid = (EmployeeKey)objectId; fm.storeIntField (0, oid.id); fm.storeStringField (1, oid.name); fm.storeObjectField (2, oid.salary); } The implementation |
7 | , Object oid ) Copy fields from an outside source to the key fields in the ObjectId. This method ... fm, Object objectId) { EmployeeKey oid = (EmployeeKey)objectId; oid.id = fm.fetchIntField (0); oid.name = fm.fetchStringField (1); oid.salary = fm.fetchObjectField (2); } The implementation |
7 | , ObjectIdFieldSupplier fm, Object oid ) Copy fields from an outside source to the key fields in the ObjectId ... , and Float salary) would have the method generated: void jdoCopyKeyFieldsToObjectId (Object oid, ObjectIdFieldSupplier fm) { oid.id = fm.fetchIntField (0); oid.name = fm.fetchStringField (1); oid |
7 | , ObjectIdFieldConsumer fm, Object oid ) Copy fields to an outside source from the key fields in the ObjectId ... (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 |
6 | Method javax.jdo.PersistenceManager Collection getObjectsById( Collection oids, boolean validate ) Return the objects with the given oids. Parameters: oids - the oids of the objects to return ... that were looked up, in the same order as the oids parameter. Since: JDO 2.0 See Also: getObjectById(Object,boolean) |
6 | Method javax.jdo.PersistenceManager Object[] getObjectsById( Object[] oids, boolean validate ) Return the objects with the given oids. Parameters: oids - the oids of the objects to return validate ... that were looked up, in the same order as the oids parameter. Since: JDO 2.0 See Also: getObjectById(Object,boolean) getObjectsById(boolean,Object...) |
6 | Method javax.jdo.PersistenceManager Collection getObjectsById( Collection oids ) Return the objects with the given oids. This method is equivalent to calling getObjectsById(Collection, boolean) with the validate flag true. Parameters: oids - the oids of the objects to return Returns: the objects |
6 | Method javax.jdo.PersistenceManager Object[] getObjectsById( boolean validate, Object... oids ) Return the objects with the given oids. Parameters: validate - if true, the existance of the objects in the datastore will be validated. oids - the oids of the objects to return Returns: the objects |