/** * PUBLIC: * Allow for the selection object of the query to be refreshed or put into the EclipseLink cache. * By default on a read or refresh the object in the cache is refreshed and returned or a new object is built from the database, * in some cases such as EJB BMP it is desirable to refresh or load into the object passed into the read object query. * <p>Note: This forces the selection object into the cache a replaces any existing object that may already be there, * this is a strict violation of object identity and other objects can still be referring to the old object. */ public void loadResultIntoSelectionObject() { setShouldLoadResultIntoSelectionObject(true); }
/** * PUBLIC: * Do not refesh/load into the selection object, this is the default. * This property allows for the selection object of the query to be refreshed or put into the TopLink cache. * By default on a read or refresh the object in the cache is refreshed and returned or a new object is built from the database, * in some cases such as EJB BMP it is desirable to refresh or load into the object passed into the read object query. * <p>Note: This forces the selection object into the cache a replaces any existing object that may already be there, * this is a strict violation of object identity and other objects can still be refering to the old object. */ public void dontLoadResultIntoSelectionObject() { setShouldLoadResultIntoSelectionObject(false); }
/** * PUBLIC: * Allow for the selection object of the query to be refreshed or put into the EclipseLink cache. * By default on a read or refresh the object in the cache is refreshed and returned or a new object is built from the database, * in some cases such as EJB BMP it is desirable to refresh or load into the object passed into the read object query. * <p>Note: This forces the selection object into the cache a replaces any existing object that may already be there, * this is a strict violation of object identity and other objects can still be referring to the old object. */ public void loadResultIntoSelectionObject() { setShouldLoadResultIntoSelectionObject(true); }
/** * PUBLIC: * Do not refesh/load into the selection object, this is the default. * This property allows for the selection object of the query to be refreshed or put into the TopLink cache. * By default on a read or refresh the object in the cache is refreshed and returned or a new object is built from the database, * in some cases such as EJB BMP it is desirable to refresh or load into the object passed into the read object query. * <p>Note: This forces the selection object into the cache a replaces any existing object that may already be there, * this is a strict violation of object identity and other objects can still be refering to the old object. */ public void dontLoadResultIntoSelectionObject() { setShouldLoadResultIntoSelectionObject(false); }
/** * PUBLIC: * Do not refesh/load into the selection object, this is the default. * This property allows for the selection object of the query to be refreshed or put into the TopLink cache. * By default on a read or refresh the object in the cache is refreshed and returned or a new object is built from the database, * in some cases such as EJB BMP it is desirable to refresh or load into the object passed into the read object query. * <p>Note: This forces the selection object into the cache a replaces any existing object that may already be there, * this is a strict violation of object identity and other objects can still be refering to the old object. */ public void dontLoadResultIntoSelectionObject() { setShouldLoadResultIntoSelectionObject(false); }
/** * PUBLIC: * Allow for the selection object of the query to be refreshed or put into the EclipseLink cache. * By default on a read or refresh the object in the cache is refreshed and returned or a new object is built from the database, * in some cases such as EJB BMP it is desirable to refresh or load into the object passed into the read object query. * <p>Note: This forces the selection object into the cache a replaces any existing object that may already be there, * this is a strict violation of object identity and other objects can still be referring to the old object. */ public void loadResultIntoSelectionObject() { setShouldLoadResultIntoSelectionObject(true); }
query.setShouldLoadResultIntoSelectionObject(true);
/** * INTERNAL: * Set the properties needed to be cascaded into the custom query inlucding the translation row. */ protected void prepareCustomQuery(DatabaseQuery customQuery) { ReadObjectQuery customReadQuery = (ReadObjectQuery)customQuery; customReadQuery.setShouldRefreshIdentityMapResult(shouldRefreshIdentityMapResult()); customReadQuery.setCascadePolicy(getCascadePolicy()); customReadQuery.setShouldMaintainCache(shouldMaintainCache()); customReadQuery.setShouldUseWrapperPolicy(shouldUseWrapperPolicy()); // CR... was missing some values, execution could cause infinite loop. customReadQuery.setQueryId(getQueryId()); customReadQuery.setExecutionTime(getExecutionTime()); customReadQuery.setShouldLoadResultIntoSelectionObject(shouldLoadResultIntoSelectionObject()); AbstractRecord primaryKeyRow; if (getSelectionObject() != null) { // CR#... Must also set the selection object as may be loading into the object (refresh) customReadQuery.setSelectionObject(getSelectionObject()); // The translation/primary key row will be set in prepareForExecution. } else if (getSelectionKey() != null) { customReadQuery.setSelectionKey(getSelectionKey()); } else { // The primary key row must be used. primaryKeyRow = customQuery.getDescriptor().getObjectBuilder().extractPrimaryKeyRowFromExpression(getSelectionCriteria(), customQuery.getTranslationRow(), customReadQuery.getSession()); customReadQuery.setTranslationRow(primaryKeyRow); } }