/** * Sets the underlying id of an ObjectId. Should only * be used with simple (idclass) types. */ public static void setAppId(ObjectId id, Object newId) { id.setId(newId); }
/** * Sets the underlying id of an ObjectId. Should only * be used with simple (idclass) types. */ public static void setAppId(ObjectId id, Object newId) { id.setId(newId); }
/** * Sets the underlying id of an ObjectId. Should only * be used with simple (idclass) types. */ public static void setAppId(ObjectId id, Object newId) { id.setId(newId); }
/** * Sets the underlying id of an ObjectId. Should only * be used with simple (idclass) types. */ public static void setAppId(ObjectId id, Object newId) { id.setId(newId); }
/** * Generate an application id based on the current primary key field state * of the given instance. */ public static Object create(PersistenceCapable pc, ClassMetaData meta) { if (pc == null) return null; Object oid = pc.pcNewObjectIdInstance(); if (oid == null) return null; if (!meta.isOpenJPAIdentity()) { pc.pcCopyKeyFieldsToObjectId(oid); return oid; } FieldMetaData pk = meta.getPrimaryKeyFields()[0]; if (pk.getDeclaredTypeCode() != JavaTypes.OID) return oid; // always copy oid object in case field value mutates or becomes // managed ObjectId objid = (ObjectId) oid; ClassMetaData embed = pk.getEmbeddedMetaData(); objid.setId(copy(objid.getId(), embed, embed.getFields())); return objid; }
/** * Generate an application id based on the current primary key field state * of the given instance. */ public static Object create(PersistenceCapable pc, ClassMetaData meta) { if (pc == null) return null; Object oid = pc.pcNewObjectIdInstance(); if (oid == null) return null; if (!meta.isOpenJPAIdentity()) { pc.pcCopyKeyFieldsToObjectId(oid); return oid; } FieldMetaData pk = meta.getPrimaryKeyFields()[0]; if (pk.getDeclaredTypeCode() != JavaTypes.OID) return oid; // always copy oid object in case field value mutates or becomes // managed ObjectId objid = (ObjectId) oid; ClassMetaData embed = pk.getEmbeddedMetaData(); objid.setId(copy(objid.getId(), embed, embed.getFields())); return objid; }
/** * Generate an application id based on the current primary key field state * of the given instance. */ public static Object create(PersistenceCapable pc, ClassMetaData meta) { if (pc == null) return null; Object oid = pc.pcNewObjectIdInstance(); if (oid == null) return null; if (!meta.isOpenJPAIdentity()) { pc.pcCopyKeyFieldsToObjectId(oid); return oid; } FieldMetaData pk = meta.getPrimaryKeyFields()[0]; if (pk.getDeclaredTypeCode() != JavaTypes.OID) return oid; // always copy oid object in case field value mutates or becomes // managed ObjectId objid = (ObjectId) oid; ClassMetaData embed = pk.getEmbeddedMetaData(); objid.setId(copy(objid.getId(), embed, embed.getFields())); return objid; }
/** * Generate an application id based on the current primary key field state * of the given instance. */ public static Object create(PersistenceCapable pc, ClassMetaData meta) { if (pc == null) return null; Object oid = pc.pcNewObjectIdInstance(); if (oid == null) return null; if (!meta.isOpenJPAIdentity()) { pc.pcCopyKeyFieldsToObjectId(oid); return oid; } FieldMetaData pk = meta.getPrimaryKeyFields()[0]; if (pk.getDeclaredTypeCode() != JavaTypes.OID) return oid; // always copy oid object in case field value mutates or becomes // managed ObjectId objid = (ObjectId) oid; ClassMetaData embed = pk.getEmbeddedMetaData(); objid.setId(copy(objid.getId(), embed, embed.getFields())); return objid; }
/** * Generate an application id based on the current primary key field state * of the given instance. */ public static Object create(PersistenceCapable pc, ClassMetaData meta) { if (pc == null) return null; Object oid = pc.pcNewObjectIdInstance(); if (oid == null) return null; if (!meta.isOpenJPAIdentity()) { pc.pcCopyKeyFieldsToObjectId(oid); return oid; } FieldMetaData pk = meta.getPrimaryKeyFields()[0]; if (pk.getDeclaredTypeCode() != JavaTypes.OID) return oid; // always copy oid object in case field value mutates or becomes // managed ObjectId objid = (ObjectId) oid; ClassMetaData embed = pk.getEmbeddedMetaData(); objid.setId(copy(objid.getId(), embed, embed.getFields())); return objid; }