/** * Instantiate the object by executing the query on the session. */ protected Object instantiate(AbstractSession session) throws DatabaseException { if (session == null) { throw ValidationException.instantiatingValueholderWithNullSession(); } return session.executeQuery(getQuery(), getRow()); }
/** * Instantiate the object by executing the query on the session. */ protected Object instantiate(AbstractSession session) throws DatabaseException { if (session == null) { throw ValidationException.instantiatingValueholderWithNullSession(); } if (this.query.isObjectBuildingQuery() && ((ObjectBuildingQuery)this.query).shouldRefreshIdentityMapResult()){ this.refreshCascade = ((ObjectBuildingQuery)this.query).getCascadePolicy(); } Object result = session.executeQuery(getQuery(), getRow()); // Bug 489898 - ensure that the query's session is dereferenced, post-execution getQuery().setSession(null); return result; }
if (getQuery() instanceof ReadAllQuery) { if (!org.eclipse.persistence.internal.helper.CubaUtil.isSoftDeletion()) { ReadQuery query = (ReadQuery) getQuery().clone(); query.setIsPrepared(false); return session.executeQuery(query, getRow()); return session.executeQuery(getQuery(), getRow()); } else { boolean softDeletionByMapping = false; DatabaseMapping databaseMapping = getQuery().getSourceMapping(); if (databaseMapping != null && databaseMapping.isOneToOneMapping()) { OneToOneMapping oneToOneMapping = (OneToOneMapping) databaseMapping; ReadQuery query = (ReadQuery) getQuery().clone(); query.setIsPrepared(false); return session.executeQuery(query, getRow()); Boolean prevSoftDeletion = org.eclipse.persistence.internal.helper.CubaUtil.setSoftDeletion(false); try { ReadQuery query = (ReadQuery) getQuery().clone(); query.setIsPrepared(false); return session.executeQuery(query, getRow());