/** * Return the result object based on its cached oid. */ private static Object fromObjectId(Object oid, StoreContext sctx, FetchConfiguration fc) { if (oid == null) return null; Object obj = sctx.find(oid, fc, null, null, 0); if (obj == null) throw new ObjectNotFoundException(oid); return obj; }
/** * Transform the given data into a relation field value. Default * implementation assumes the data is an oid. */ protected Object toRelationField(OpenJPAStateManager sm, ValueMetaData vmd, Object data, FetchConfiguration fetch, Object context) { return sm.getContext().find(data, fetch, null, null, 0); }
/** * Transform the given data into a relation field value. Default * implementation assumes the data is an oid. */ protected Object toRelationField(OpenJPAStateManager sm, ValueMetaData vmd, Object data, FetchConfiguration fetch, Object context) { return sm.getContext().find(data, fetch, null, null, 0); }
/** * Return the result object based on its cached oid. */ private static Object fromObjectId(Object oid, StoreContext sctx) { if (oid == null) return null; Object obj = sctx.find(oid, null, null, null, 0); if (obj == null) throw new ObjectNotFoundException(oid); return obj; }
/** * Return the result object based on its cached oid. */ private static Object fromObjectId(Object oid, StoreContext sctx, FetchConfiguration fc) { if (oid == null) return null; Object obj = sctx.find(oid, fc, null, null, 0); if (obj == null) throw new ObjectNotFoundException(oid); return obj; }
/** * Return the result object based on its cached oid. */ private static Object fromObjectId(Object oid, StoreContext sctx) { if (oid == null) return null; Object obj = sctx.find(oid, null, null, null, 0); if (obj == null) throw new ObjectNotFoundException(oid); return obj; }
/** * Transform the given data into a relation field value. Default * implementation assumes the data is an oid. */ protected Object toRelationField(OpenJPAStateManager sm, ValueMetaData vmd, Object data, FetchConfiguration fetch, Object context) { return sm.getContext().find(data, fetch, null, null, 0); }
/** * Transform the given data into a relation field value. Default * implementation assumes the data is an oid. */ protected Object toRelationField(OpenJPAStateManager sm, ValueMetaData vmd, Object data, FetchConfiguration fetch, Object context) { return sm.getContext().find(data, fetch, null, null, 0); }
/** * Return the result object based on its cached oid. */ private static Object fromObjectId(Object oid, StoreContext sctx) { if (oid == null) return null; Object obj = sctx.find(oid, null, null, null, 0); if (obj == null) throw new ObjectNotFoundException(oid); return obj; }
/** * Transform the given data into a relation field value. Default * implementation assumes the data is an oid. */ protected Object toRelationField(OpenJPAStateManager sm, ValueMetaData vmd, Object data, FetchConfiguration fetch, Object context) { return sm.getContext().find(data, fetch, null, null, 0); }
/** * 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; }
@Override public Object getResultObject() throws Exception { DynamicComposite current = results.get(index); int length = current.getComponents().size(); Object id = keyStrategy.getInstance(current.getComponent(length - 1) .getBytes()); Object jpaId = ctx.newObjectId(classMeta.getDescribedType(), id); return ctx.find(jpaId, fetchConfig, null, null, 0); }
public Object getResultObject() throws Exception { Class type = getPCType(); MetaDataRepository repos = ctx.getConfiguration(). getMetaDataRepositoryInstance(); ClassMetaData meta = repos.getMetaData (type, ctx.getClassLoader(), true); Object oid = getObjectId(meta); Object res = ctx.find(oid, null, null, this, 0); if (res == null) throw new ObjectNotFoundException(oid); return res; }
public Object getResultObject() throws Exception { Class type = getPCType(); MetaDataRepository repos = ctx.getConfiguration(). getMetaDataRepositoryInstance(); ClassMetaData meta = repos.getMetaData (type, ctx.getClassLoader(), true); Object oid = getObjectId(meta); Object res = ctx.find(oid, null, null, this, 0); if (res == null) throw new ObjectNotFoundException(oid); return res; }
public Object getResultObject() throws Exception { Class type = getPCType(); MetaDataRepository repos = ctx.getConfiguration(). getMetaDataRepositoryInstance(); ClassMetaData meta = repos.getMetaData (type, ctx.getClassLoader(), true); Object oid = getObjectId(meta); Object res = ctx.find(oid, null, null, this, 0); if (res == null) throw new ObjectNotFoundException(oid); return res; }
/** * 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; }
public Object getResultObject() throws Exception { Class type = getPCType(); MetaDataRepository repos = ctx.getConfiguration(). getMetaDataRepositoryInstance(); ClassMetaData meta = repos.getMetaData (type, ctx.getClassLoader(), true); Object oid = getObjectId(meta); Object res = ctx.find(oid, null, null, this, 0); if (res == null) throw new ObjectNotFoundException(oid); return res; }
public Object getResultObject() throws Exception { Class type = getPCType(); MetaDataRepository repos = ctx.getConfiguration(). getMetaDataRepositoryInstance(); ClassMetaData meta = repos.getMetaData (type, ctx.getClassLoader(), true); Object oid = getObjectId(meta); Object res = ctx.find(oid, null, null, this, 0); if (res == null) throw new ObjectNotFoundException(oid); return res; }
protected Object resolveObject(Object obj) { if (!(obj instanceof ObjectIdMarker)) return obj; Object oid = ((ObjectIdMarker) obj).oid; if (oid == null) return null; Object pc = _ctx.find(oid, null, null, null, 0); if (pc == null) { Log log = _ctx.getConfiguration().getLog (OpenJPAConfiguration.LOG_RUNTIME); if (log.isWarnEnabled()) log.warn(_loc.get("bad-ser-oid", oid)); if (log.isTraceEnabled()) log.trace(new ObjectNotFoundException(oid)); } return pc; } }
protected Object resolveObject(Object obj) { if (!(obj instanceof ObjectIdMarker)) return obj; Object oid = ((ObjectIdMarker) obj).oid; if (oid == null) return null; Object pc = _ctx.find(oid, null, null, null, 0); if (pc == null) { Log log = _ctx.getConfiguration().getLog (OpenJPAConfiguration.LOG_RUNTIME); if (log.isWarnEnabled()) log.warn(_loc.get("bad-ser-oid", oid)); if (log.isTraceEnabled()) log.trace(new ObjectNotFoundException(oid)); } return pc; } }