public void setAutoAssignedValue(OpenJPAStateManager sm, JDBCStore store, Column col, Object autogen) { long id = ((Number) autogen).longValue(); sm.setObjectId(store.newDataStoreId(id, (ClassMapping) sm.getMetaData(), true)); } }
public void setAutoAssignedValue(OpenJPAStateManager sm, JDBCStore store, Column col, Object autogen) { long id = ((Number) autogen).longValue(); sm.setObjectId(store.newDataStoreId(id, (ClassMapping) sm.getMetaData(), true)); } }
public void setAutoAssignedValue(OpenJPAStateManager sm, JDBCStore store, Column col, Object autogen) { long id = ((Number) autogen).longValue(); sm.setObjectId(store.newDataStoreId(id, (ClassMapping) sm.getMetaData(), true)); } }
public void setAutoAssignedValue(OpenJPAStateManager sm, JDBCStore store, Column col, Object autogen) { long id = ((Number) autogen).longValue(); sm.setObjectId(store.newDataStoreId(id, (ClassMapping) sm.getMetaData(), true)); } }
public void setAutoAssignedValue(OpenJPAStateManager sm, JDBCStore store, Column col, Object autogen) { long id = ((Number) autogen).longValue(); sm.setObjectId(store.newDataStoreId(id, (ClassMapping) sm.getMetaData(), true)); } }
/** * Extract the oid value from the given result. If the next oid is the * same as the given one, returns the given JVM instance. */ private Object getNextObjectId(ClassMapping owner, JDBCStore store, Result res, Object oid) throws SQLException { // if this is a datastore id class we can avoid creating a new oid // object for the common case if (oid != null && owner.getIdentityType() == ClassMapping.ID_DATASTORE && owner.isPrimaryKeyObjectId(true)) { long nid = res.getLong(owner.getPrimaryKeyColumns()[0]); long id = ((Id) oid).getId(); return (nid == id) ? oid : store.newDataStoreId(nid, owner, true); } Object noid = owner.getObjectId(store, res, null, true, null); if (noid == null) return null; return (noid.equals(oid)) ? oid : noid; }
/** * Extract the oid value from the given result. If the next oid is the * same as the given one, returns the given JVM instance. */ private Object getNextObjectId(ClassMapping owner, JDBCStore store, Result res, Object oid) throws SQLException { // if this is a datastore id class we can avoid creating a new oid // object for the common case if (oid != null && owner.getIdentityType() == ClassMapping.ID_DATASTORE && owner.isPrimaryKeyObjectId(true)) { long nid = res.getLong(owner.getPrimaryKeyColumns()[0]); long id = ((Id) oid).getId(); return (nid == id) ? oid : store.newDataStoreId(nid, owner, true); } Object noid = owner.getObjectId(store, res, null, true, null); if (noid == null) return null; return (noid.equals(oid)) ? oid : noid; }
/** * Extract the oid value from the given result. If the next oid is the * same as the given one, returns the given JVM instance. */ private Object getNextObjectId(ClassMapping owner, JDBCStore store, Result res, Object oid) throws SQLException { // if this is a datastore id class we can avoid creating a new oid // object for the common case if (oid != null && owner.getIdentityType() == ClassMapping.ID_DATASTORE && owner.isPrimaryKeyObjectId(true)) { long nid = res.getLong(owner.getPrimaryKeyColumns()[0]); long id = ((Id) oid).getId(); return (nid == id) ? oid : store.newDataStoreId(nid, owner, true); } Object noid = owner.getObjectId(store, res, null, true, null); if (noid == null) return null; return (noid.equals(oid)) ? oid : noid; }
/** * Extract the oid value from the given result. If the next oid is the * same as the given one, returns the given JVM instance. */ private Object getNextObjectId(ClassMapping owner, JDBCStore store, Result res, Object oid) throws SQLException { // if this is a datastore id class we can avoid creating a new oid // object for the common case if (oid != null && owner.getIdentityType() == ClassMapping.ID_DATASTORE && owner.isPrimaryKeyObjectId(true)) { long nid = res.getLong(owner.getPrimaryKeyColumns()[0]); long id = ((Id) oid).getId(); return (nid == id) ? oid : store.newDataStoreId(nid, owner, true); } Object noid = owner.getObjectId(store, res, null, true, null); if (noid == null) return null; return (noid.equals(oid)) ? oid : noid; }
/** * Extract the oid value from the given result. If the next oid is the * same as the given one, returns the given JVM instance. */ private Object getNextObjectId(ClassMapping owner, JDBCStore store, Result res, Object oid) throws SQLException { // if this is a datastore id class we can avoid creating a new oid // object for the common case if (oid != null && owner.getIdentityType() == ClassMapping.ID_DATASTORE && owner.isPrimaryKeyObjectId(true)) { long nid = res.getLong(owner.getPrimaryKeyColumns()[0]); long id = ((Id) oid).getId(); return (nid == id) ? oid : store.newDataStoreId(nid, owner, true); } Object noid = owner.getObjectId(store, res, null, true, null); if (noid == null) return null; return (noid.equals(oid)) ? oid : noid; }
oid = null; else if (relMapping.getIdentityType() == ClassMapping.ID_DATASTORE) oid = store.newDataStoreId(((Number) val).longValue(), relMapping, field.getPolymorphic() != ValueMapping.POLY_FALSE); else {
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException { ClassMapping relmapping = field.getTypeMapping(); if (relmapping.getIdentityType() == ClassMapping.ID_DATASTORE) { Column col = cols[0]; if (fk != null) col = fk.getColumn(col); long id = res.getLong(col, joins); if (field.getObjectIdFieldTypeCode() == JavaTypes.LONG) return id; return store.newDataStoreId(id, relmapping, field.getPolymorphic() != ValueMapping.POLY_FALSE); } if (relmapping.isOpenJPAIdentity()) return ((Joinable) relmapping.getPrimaryKeyFieldMappings()[0]. getStrategy()).getPrimaryKeyValue(res, cols, fk, store, joins); if (cols == getColumns() && fk == null) fk = field.getForeignKey(); else fk = createTranslatingForeignKey(relmapping, cols, fk); return relmapping.getObjectId(store, res, fk, field.getPolymorphic() != ValueMapping.POLY_FALSE, joins); }
oid = null; else if (relMapping.getIdentityType() == ClassMapping.ID_DATASTORE) oid = store.newDataStoreId(((Number) val).longValue(), relMapping, field.getPolymorphic() != ValueMapping.POLY_FALSE); else {
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException { ClassMapping relmapping = field.getTypeMapping(); if (relmapping.getIdentityType() == ClassMapping.ID_DATASTORE) { Column col = cols[0]; if (fk != null) col = fk.getColumn(col); long id = res.getLong(col, joins); if (field.getObjectIdFieldTypeCode() == JavaTypes.LONG) return Numbers.valueOf(id); return store.newDataStoreId(id, relmapping, field.getPolymorphic() != ValueMapping.POLY_FALSE); } if (relmapping.isOpenJPAIdentity()) return ((Joinable) relmapping.getPrimaryKeyFieldMappings()[0]. getStrategy()).getPrimaryKeyValue(res, cols, fk, store, joins); if (cols == getColumns() && fk == null) fk = field.getForeignKey(); else fk = createTranslatingForeignKey(relmapping, cols, fk); return relmapping.getObjectId(store, res, fk, field.getPolymorphic() != ValueMapping.POLY_FALSE, joins); }
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException { ClassMapping relmapping = field.getTypeMapping(); if (relmapping.getIdentityType() == ClassMapping.ID_DATASTORE) { Column col = cols[0]; if (fk != null) col = fk.getColumn(col); long id = res.getLong(col, joins); if (field.getObjectIdFieldTypeCode() == JavaTypes.LONG) return id; return store.newDataStoreId(id, relmapping, field.getPolymorphic() != ValueMapping.POLY_FALSE); } if (relmapping.isOpenJPAIdentity()) return ((Joinable) relmapping.getPrimaryKeyFieldMappings()[0]. getStrategy()).getPrimaryKeyValue(res, cols, fk, store, joins); if (cols == getColumns() && fk == null) fk = field.getForeignKey(); else fk = createTranslatingForeignKey(relmapping, cols, fk); return relmapping.getObjectId(store, res, fk, field.getPolymorphic() != ValueMapping.POLY_FALSE, joins); }
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException { ClassMapping relmapping = field.getTypeMapping(); if (relmapping.getIdentityType() == ClassMapping.ID_DATASTORE) { Column col = cols[0]; if (fk != null) col = fk.getColumn(col); long id = res.getLong(col, joins); if (field.getObjectIdFieldTypeCode() == JavaTypes.LONG) return id; return store.newDataStoreId(id, relmapping, field.getPolymorphic() != ValueMapping.POLY_FALSE); } if (relmapping.isOpenJPAIdentity()) return ((Joinable) relmapping.getPrimaryKeyFieldMappings()[0]. getStrategy()).getPrimaryKeyValue(res, cols, fk, store, joins); if (cols == getColumns() && fk == null) fk = field.getForeignKey(); else fk = createTranslatingForeignKey(relmapping, cols, fk); return relmapping.getObjectId(store, res, fk, field.getPolymorphic() != ValueMapping.POLY_FALSE, joins); }
public Object getPrimaryKeyValue(Result res, Column[] cols, ForeignKey fk, JDBCStore store, Joins joins) throws SQLException { ClassMapping relmapping = field.getTypeMapping(); if (relmapping.getIdentityType() == ClassMapping.ID_DATASTORE) { Column col = cols[0]; if (fk != null) col = fk.getColumn(col); long id = res.getLong(col, joins); if (field.getObjectIdFieldTypeCode() == JavaTypes.LONG) return id; return store.newDataStoreId(id, relmapping, field.getPolymorphic() != ValueMapping.POLY_FALSE); } if (relmapping.isOpenJPAIdentity()) return ((Joinable) relmapping.getPrimaryKeyFieldMappings()[0]. getStrategy()).getPrimaryKeyValue(res, cols, fk, store, joins); if (cols == getColumns() && fk == null) fk = field.getForeignKey(); else fk = createTranslatingForeignKey(relmapping, cols, fk); return relmapping.getObjectId(store, res, fk, field.getPolymorphic() != ValueMapping.POLY_FALSE, joins); }
oid = null; else if (relMapping.getIdentityType() == ClassMapping.ID_DATASTORE) oid = store.newDataStoreId(((Number) val).longValue(), relMapping, field.getPolymorphic() != ValueMapping.POLY_FALSE); else {
oid = null; else if (relMapping.getIdentityType() == ClassMapping.ID_DATASTORE) oid = store.newDataStoreId(((Number) val).longValue(), relMapping, field.getPolymorphic() != ValueMapping.POLY_FALSE); else {
long id = res.getLong(cols[0]); if (!res.wasNull()) oid = store.newDataStoreId(id, relMapping, true); } else {