/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by the batchQuery. * In this case, wrap the query in a ValueHolder for later invocation. */ public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey) { return new BatchValueHolder(batchQuery, row, this.getForeignReferenceMapping(), originalQuery, parentCacheKey); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by the batchQuery. * In this case, wrap the query in a ValueHolder for later invocation. */ public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery) { return new BatchValueHolder(batchQuery, row, this.getForeignReferenceMapping(), originalQuery); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by the batchQuery. * In this case, wrap the query in a ValueHolder for later invocation. */ public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey) { return new BatchValueHolder(batchQuery, row, this.getForeignReferenceMapping(), originalQuery, parentCacheKey); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by the batchQuery. * In this case, wrap the query in an IndirectContainer for later invocation. */ public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey) { return this.buildIndirectContainer(new BatchValueHolder(batchQuery, row, getForeignReferenceMapping(), originalQuery, parentCacheKey)); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by the batchQuery. * In this case, wrap the query in an IndirectContainer for later invocation. */ public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery) { return this.buildIndirectContainer(new BatchValueHolder(batchQuery, row, getForeignReferenceMapping(), originalQuery)); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by the batchQuery. * In this case, wrap the query in an IndirectContainer for later invocation. */ public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey) { return this.buildIndirectContainer(new BatchValueHolder(batchQuery, row, getForeignReferenceMapping(), originalQuery, parentCacheKey)); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by the batch query. * * NOTE: Currently not supported anyway. */ public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery) { Object object; try { // Need an instance of the implementing class ClassDescriptor d = originalQuery.getDescriptor(); if (d.isDescriptorForInterface()) { d = (ClassDescriptor)originalQuery.getDescriptor().getInterfacePolicy().getChildDescriptors().firstElement(); } if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ object = AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(d.getJavaClass())); }else{ object = PrivilegedAccessHelper.newInstanceFromClass(d.getJavaClass()); } } catch (Exception e) { //org.eclipse.persistence.internal.helper.Helper.toDo("*** Should probably throw some sort of TopLink exception here. ***"); e.printStackTrace(); return null; } ValueHolderInterface valueHolder = new BatchValueHolder(batchQuery, row, this.getForeignReferenceMapping(), originalQuery); return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by the batch query. * * NOTE: Currently not supported anyway. */ public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey) { Object object; try { // Need an instance of the implementing class ClassDescriptor d = originalQuery.getDescriptor(); if (d.isDescriptorForInterface()) { d = originalQuery.getDescriptor().getInterfacePolicy().getChildDescriptors().get(0); } if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ object = AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(d.getJavaClass())); }else{ object = PrivilegedAccessHelper.newInstanceFromClass(d.getJavaClass()); } } catch (Exception e) { //org.eclipse.persistence.internal.helper.Helper.toDo("*** Should probably throw some sort of TopLink exception here. ***"); e.printStackTrace(); return null; } ValueHolderInterface valueHolder = new BatchValueHolder(batchQuery, row, this.getForeignReferenceMapping(), originalQuery, parentCacheKey); return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder); }
/** * INTERNAL: * Return the value to be stored in the object's attribute. * This value is determined by the batch query. * * NOTE: Currently not supported anyway. */ public Object valueFromBatchQuery(ReadQuery batchQuery, AbstractRecord row, ObjectLevelReadQuery originalQuery, CacheKey parentCacheKey) { Object object; try { // Need an instance of the implementing class ClassDescriptor d = originalQuery.getDescriptor(); if (d.isDescriptorForInterface()) { d = originalQuery.getDescriptor().getInterfacePolicy().getChildDescriptors().get(0); } if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ object = AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(d.getJavaClass())); }else{ object = PrivilegedAccessHelper.newInstanceFromClass(d.getJavaClass()); } } catch (Exception e) { //org.eclipse.persistence.internal.helper.Helper.toDo("*** Should probably throw some sort of TopLink exception here. ***"); e.printStackTrace(); return null; } ValueHolderInterface valueHolder = new BatchValueHolder(batchQuery, row, this.getForeignReferenceMapping(), originalQuery, parentCacheKey); return ProxyIndirectionHandler.newProxyInstance(object.getClass(), targetInterfaces, valueHolder); }