/** * INTERNAL: * Set the cached SQL call for the expression query. * PERF: Allow caching of expression query SQL call to avoid regeneration. */ public void putCachedExpressionQuery(DatabaseQuery query) { this.cachedExpressionQueries.put(query, query); } }
/** * INTERNAL: * Set the cached SQL call for the expression query. * PERF: Allow caching of expression query SQL call to avoid regeneration. */ public void putCachedExpressionQuery(DatabaseQuery query) { getCachedExpressionQueries().put(query, query); }
/** * INTERNAL: * Set the cached SQL call for the expression query. * PERF: Allow caching of expression query SQL call to avoid regeneration. */ public void putCachedExpressionQuery(DatabaseQuery query) { getCachedExpressionQueries().put(query, query); }
/** * INTERNAL: * Cache a clone of the update SQL calls based on the updated fields. * If the max size is reached, do not cache the call. * The call's query must be dereferenced in order to allow the GC of a related session. * PERF: Allow caching of the update SQL call to avoid regeneration. */ public void putCachedUpdateCalls(Vector updateFields, Vector updateCalls) { Vector vectorToCache = updateCalls; if (!updateCalls.isEmpty()) { int updateCallsSize = updateCalls.size(); vectorToCache = new NonSynchronizedVector(updateCallsSize); for (int i = 0; i < updateCallsSize; i++) { DatasourceCall updateCall = (DatasourceCall)updateCalls.get(i); // clone call and dereference query for DatasourceCall and EJBQLCall DatasourceCall clonedUpdateCall = (DatasourceCall) updateCall.clone(); clonedUpdateCall.setQuery(null); vectorToCache.add(clonedUpdateCall); } } this.cachedUpdateCalls.put(updateFields, vectorToCache); }
/** * INTERNAL: * Cache a clone of the update SQL calls based on the updated fields. * If the max size is reached, do not cache the call. * The call's query must be dereferenced in order to allow the GC of a related session. * PERF: Allow caching of the update SQL call to avoid regeneration. */ public void putCachedUpdateCalls(Vector updateFields, Vector updateCalls) { Vector vectorToCache = updateCalls; if (!updateCalls.isEmpty()) { int updateCallsSize = updateCalls.size(); vectorToCache = new NonSynchronizedVector(updateCallsSize); for (int i = 0; i < updateCallsSize; i++) { DatasourceCall updateCall = (DatasourceCall)updateCalls.get(i); // clone call and dereference query for DatasourceCall and EJBQLCall DatasourceCall clonedUpdateCall = (DatasourceCall) updateCall.clone(); clonedUpdateCall.setQuery(null); vectorToCache.add(clonedUpdateCall); } } getCachedUpdateCalls().put(updateFields, vectorToCache); }
/** * INTERNAL: * Cache a clone of the update SQL calls based on the updated fields. * If the max size is reached, do not cache the call. * The call's query must be dereferenced in order to allow the GC of a related session. * PERF: Allow caching of the update SQL call to avoid regeneration. */ public void putCachedUpdateCalls(Vector updateFields, Vector updateCalls) { Vector vectorToCache = updateCalls; if (!updateCalls.isEmpty()) { int updateCallsSize = updateCalls.size(); vectorToCache = new NonSynchronizedVector(updateCallsSize); for (int i = 0; i < updateCallsSize; i++) { DatasourceCall updateCall = (DatasourceCall)updateCalls.get(i); // clone call and dereference query for DatasourceCall and EJBQLCall DatasourceCall clonedUpdateCall = (DatasourceCall) updateCall.clone(); clonedUpdateCall.setQuery(null); vectorToCache.add(clonedUpdateCall); } } getCachedUpdateCalls().put(updateFields, vectorToCache); }
/** * Populate the query using the information retrieved from parsing the JPQL. */ public void populateQuery(String jpqlString, ObjectLevelReadQuery query, AbstractSession session) { // PERF: Check if the JPQL has already been parsed. // Only allow queries with default properties to be parse cached. boolean isCacheable = query.isDefaultPropertiesQuery(); DatabaseQuery cachedQuery = null; if (isCacheable) { cachedQuery = (DatabaseQuery)session.getProject().getJPQLParseCache().get(jpqlString); } if ((cachedQuery == null) || (!cachedQuery.isPrepared()) || (cachedQuery.getClass() != query.getClass())) { JPQLParser parser = parseEJBQLString(jpqlString); JPQLParseTree parseTree = parser.getParseTree(); parseTree.populateQuery(query, session); if (isCacheable) { session.getProject().getJPQLParseCache().put(jpqlString, query); } } else { query.prepareFromQuery(cachedQuery); query.setIsPrepared(true); } }
/** * Populate the query using the information retrieved from parsing the JPQL. */ public void populateQuery(String jpqlString, ObjectLevelReadQuery query, AbstractSession session) { // PERF: Check if the JPQL has already been parsed. // Only allow queries with default properties to be parse cached. boolean isCacheable = query.isDefaultPropertiesQuery(); DatabaseQuery cachedQuery = null; if (isCacheable) { cachedQuery = (DatabaseQuery)session.getProject().getJPQLParseCache().get(jpqlString); } if ((cachedQuery == null) || (!cachedQuery.isPrepared()) || (cachedQuery.getClass() != query.getClass())) { JPQLParser parser = parseEJBQLString(jpqlString); JPQLParseTree parseTree = parser.getParseTree(); parseTree.populateQuery(query, session); if (isCacheable) { session.getProject().getJPQLParseCache().put(jpqlString, query); } } else { query.prepareFromQuery(cachedQuery); query.setIsPrepared(true); } }
/** * Populate the query using the information retrieved from parsing the JPQL. */ public void populateQuery(String jpqlString, ObjectLevelReadQuery query, AbstractSession session) { // PERF: Check if the JPQL has already been parsed. // Only allow queries with default properties to be parse cached. boolean isCacheable = query.isDefaultPropertiesQuery(); DatabaseQuery cachedQuery = null; if (isCacheable) { cachedQuery = (DatabaseQuery)session.getProject().getJPQLParseCache().get(jpqlString); } if ((cachedQuery == null) || (!cachedQuery.isPrepared()) || (cachedQuery.getClass() != query.getClass())) { JPQLParser parser = parseEJBQLString(jpqlString); JPQLParseTree parseTree = parser.getParseTree(); parseTree.populateQuery(query, session); if (isCacheable) { session.getProject().getJPQLParseCache().put(jpqlString, query); } } else { query.prepareFromQuery(cachedQuery); query.setIsPrepared(true); } }
session.getProject().getJPQLParseCache().put(jpqlQuery, databaseQuery);