/** * Find the object with the given oid. */ public Object find(Object oid, ValueMapping vm, JDBCFetchConfiguration fetch) { if (oid == null) return null; Object pc = _ctx.find(oid, fetch, null, null, 0); if (pc == null && vm != null) { OrphanedKeyAction action = _conf.getOrphanedKeyActionInstance(); pc = action.orphan(oid, null, vm); } return pc; }
ret.add(sm.getContext().getConfiguration(). getOrphanedKeyActionInstance(). orphan(data, sm, vmd));
ret.add(sm.getContext().getConfiguration(). getOrphanedKeyActionInstance(). orphan(data, sm, vmd));
ret.add(sm.getContext().getConfiguration(). getOrphanedKeyActionInstance(). orphan(data, sm, vmd));
ret.add(sm.getContext().getConfiguration(). getOrphanedKeyActionInstance(). orphan(data, sm, vmd));
ret.add(sm.getContext().getConfiguration(). getOrphanedKeyActionInstance(). orphan(data, sm, vmd));
/** * Convert the given stored value <code>val</code> to a value for loading * into a state manager. The value <code>val</code> must be a singular * value; it cannot be a container. */ private static Object toNestedLoadable(OpenJPAStateManager sm, ValueMetaData vmd, Object val, FetchConfiguration fetch) { if (val == null) return null; switch (vmd.getTypeCode()) { // clone the date to prevent direct modification of our stored value case JavaTypes.DATE: return ((Date) val).clone(); case JavaTypes.PC: case JavaTypes.PC_UNTYPED: // for relations to other persistent objects, we store the // related object's oid -- convert it back into a persistent // instance StoreContext ctx = sm.getContext(); Object pc = ctx.find(val, fetch, null, null, 0); if (pc != null) return pc; OrphanedKeyAction action = ctx.getConfiguration(). getOrphanedKeyActionInstance(); return action.orphan(val, sm, vmd); default: return val; } }
/** * Convert the given stored value <code>val</code> to a value for loading * into a state manager. The value <code>val</code> must be a singular * value; it cannot be a container. */ private static Object toNestedLoadable(OpenJPAStateManager sm, ValueMetaData vmd, Object val, FetchConfiguration fetch) { if (val == null) return null; switch (vmd.getTypeCode()) { // clone the date to prevent direct modification of our stored value case JavaTypes.DATE: return ((Date) val).clone(); case JavaTypes.PC: case JavaTypes.PC_UNTYPED: // for relations to other persistent objects, we store the // related object's oid -- convert it back into a persistent // instance StoreContext ctx = sm.getContext(); Object pc = ctx.find(val, fetch, null, null, 0); if (pc != null) return pc; OrphanedKeyAction action = ctx.getConfiguration(). getOrphanedKeyActionInstance(); return action.orphan(val, sm, vmd); default: return val; } }
/** * Transform the given data value to its field value. The data value * may be a key, value, or element of a map or collection. */ protected Object toNestedField(OpenJPAStateManager sm, ValueMetaData vmd, Object data, FetchConfiguration fetch, Object context) { if (data == null) return null; switch (vmd.getDeclaredTypeCode()) { case JavaTypes.DATE: return ((Date) data).clone(); case JavaTypes.LOCALE: return (Locale) data; case JavaTypes.PC: if (vmd.isEmbedded()) return toEmbeddedField(sm, vmd, data, fetch, context); // no break case JavaTypes.PC_UNTYPED: Object ret = toRelationField(sm, vmd, data, fetch, context); if (ret != null) return ret; OrphanedKeyAction action = sm.getContext().getConfiguration(). getOrphanedKeyActionInstance(); return action.orphan(data, sm, vmd); default: return data; } }
/** * Find the object with the given oid. */ public Object find(Object oid, ValueMapping vm, JDBCFetchConfiguration fetch) { if (oid == null) return null; if (_log.isTraceEnabled()) { ClassMapping declaredTypeMapping = vm.getDeclaredTypeMapping(); Class<?> describedType = (declaredTypeMapping != null) ? declaredTypeMapping.getDescribedType() : null; _log.trace("find: oid="+oid+", describedType="+describedType); } Object pc = _ctx.find(oid, fetch, null, null, 0); if (pc == null && vm != null) { OrphanedKeyAction action = _conf.getOrphanedKeyActionInstance(); pc = action.orphan(oid, null, vm); } return pc; }
/** * Transform the given data value to its field value. The data value * may be a key, value, or element of a map or collection. */ protected Object toNestedField(OpenJPAStateManager sm, ValueMetaData vmd, Object data, FetchConfiguration fetch, Object context) { if (data == null) return null; switch (vmd.getDeclaredTypeCode()) { case JavaTypes.DATE: return ((Date) data).clone(); case JavaTypes.LOCALE: return (Locale) data; case JavaTypes.PC: if (vmd.isEmbedded()) return toEmbeddedField(sm, vmd, data, fetch, context); // no break case JavaTypes.PC_UNTYPED: Object ret = toRelationField(sm, vmd, data, fetch, context); if (ret != null) return ret; OrphanedKeyAction action = sm.getContext().getConfiguration(). getOrphanedKeyActionInstance(); return action.orphan(data, sm, vmd); default: return data; } }
/** * Transform the given data value to its field value. The data value * may be a key, value, or element of a map or collection. */ protected Object toNestedField(OpenJPAStateManager sm, ValueMetaData vmd, Object data, FetchConfiguration fetch, Object context) { if (data == null) return null; switch (vmd.getDeclaredTypeCode()) { case JavaTypes.DATE: return ((Date) data).clone(); case JavaTypes.LOCALE: return (Locale) data; case JavaTypes.PC: if (vmd.isEmbedded()) return toEmbeddedField(sm, vmd, data, fetch, context); // no break case JavaTypes.PC_UNTYPED: Object ret = toRelationField(sm, vmd, data, fetch, context); if (ret != null) return ret; OrphanedKeyAction action = sm.getContext().getConfiguration(). getOrphanedKeyActionInstance(); return action.orphan(data, sm, vmd); default: return data; } }
/** * Transform the given data value to its field value. The data value * may be a key, value, or element of a map or collection. */ protected Object toNestedField(OpenJPAStateManager sm, ValueMetaData vmd, Object data, FetchConfiguration fetch, Object context) { if (data == null) return null; switch (vmd.getDeclaredTypeCode()) { case JavaTypes.DATE: return ((Date) data).clone(); case JavaTypes.LOCALE: return (Locale) data; case JavaTypes.PC: if (vmd.isEmbedded()) return toEmbeddedField(sm, vmd, data, fetch, context); // no break case JavaTypes.PC_UNTYPED: Object ret = toRelationField(sm, vmd, data, fetch, context); if (ret != null) return ret; OrphanedKeyAction action = sm.getContext().getConfiguration(). getOrphanedKeyActionInstance(); return action.orphan(data, sm, vmd); default: return data; } }
/** * Find the object with the given oid. */ public Object find(Object oid, ValueMapping vm, JDBCFetchConfiguration fetch) { if (oid == null) return null; if (_log.isTraceEnabled()) { ClassMapping declaredTypeMapping = vm.getDeclaredTypeMapping(); Class<?> describedType = (declaredTypeMapping != null) ? declaredTypeMapping.getDescribedType() : null; _log.trace("find: oid="+oid+", describedType="+describedType); } Object pc = _ctx.find(oid, fetch, null, null, 0); if (pc == null && vm != null) { OrphanedKeyAction action = _conf.getOrphanedKeyActionInstance(); pc = action.orphan(oid, null, vm); } return pc; }
/** * Find the object with the given oid. */ public Object find(Object oid, ValueMapping vm, JDBCFetchConfiguration fetch) { if (oid == null) return null; if (_log.isTraceEnabled()) { ClassMapping declaredTypeMapping = vm.getDeclaredTypeMapping(); Class<?> describedType = (declaredTypeMapping != null) ? declaredTypeMapping.getDescribedType() : null; _log.trace("find: oid="+oid+", describedType="+describedType); } Object pc = _ctx.find(oid, fetch, null, null, 0); if (pc == null && vm != null) { OrphanedKeyAction action = _conf.getOrphanedKeyActionInstance(); pc = action.orphan(oid, null, vm); } return pc; }
/** * Transform the given data value to its field value. The data value * may be a key, value, or element of a map or collection. */ protected Object toNestedField(OpenJPAStateManager sm, ValueMetaData vmd, Object data, FetchConfiguration fetch, Object context) { if (data == null) return null; switch (vmd.getDeclaredTypeCode()) { case JavaTypes.DATE: return ((Date) data).clone(); case JavaTypes.LOCALE: return (Locale) data; case JavaTypes.PC: if (vmd.isEmbedded()) return toEmbeddedField(sm, vmd, data, fetch, context); // no break case JavaTypes.PC_UNTYPED: Object ret = toRelationField(sm, vmd, data, fetch, context); if (ret != null) return ret; OrphanedKeyAction action = sm.getContext().getConfiguration(). getOrphanedKeyActionInstance(); return action.orphan(data, sm, vmd); default: return data; } }
/** * Find the object with the given oid. */ public Object find(Object oid, ValueMapping vm, JDBCFetchConfiguration fetch) { if (oid == null) return null; if (_log.isTraceEnabled()) { ClassMapping declaredTypeMapping = vm.getDeclaredTypeMapping(); Class<?> describedType = (declaredTypeMapping != null) ? declaredTypeMapping.getDescribedType() : null; _log.trace("find: oid="+oid+", describedType="+describedType); } Object pc = _ctx.find(oid, fetch, null, null, 0); if (pc == null && vm != null) { OrphanedKeyAction action = _conf.getOrphanedKeyActionInstance(); pc = action.orphan(oid, null, vm); } return pc; }