/** * Runs a query against the database. The query is processed with an {@link OgnlSqlFormat}, so it can * access values from the OGNL context, as well as from an (optional) rootFactory object. * @param session the session * @param queryString the query * @param rootObject the rootFactory object passed to the ognl evaluator (can be null). * @param firstResult index of the first result to return * @param maxResults maximum number of results to return * @return at most <code>maxResults</code> results from the query */ public static List<Object> getObjects( Session session, String queryString, Object rootObject, @Nullable Integer firstResult, @Nullable Integer maxResults) { OgnlHqlFormat hqlFormat = OgnlHqlFormat.create(queryString); String formatString = hqlFormat.getFormatString(); Object[] parameters = hqlFormat.evaluateOgnlExpressions(rootObject); return runHqlQuery(session, formatString, parameters, firstResult, maxResults); }
/** * Runs a query against the database. The query is processed with an {@link OgnlSqlFormat}, so it can * access values from the OGNL context, as well as from an (optional) root object. * @param session the session * @param queryString the query * @param rootObject the root object passed to the ognl evaluator (can be null). * @param firstResult index of the first result to return * @param maxResults maximum number of results to return * @return at most <code>maxResults</code> results from the query */ public static List<Object> getObjects( Session session, String queryString, Object rootObject, @Nullable Integer firstResult, @Nullable Integer maxResults) { OgnlHqlFormat hqlFormat = OgnlHqlFormat.create(queryString); String formatString = hqlFormat.getFormatString(); Object[] parameters = hqlFormat.evaluateOgnlExpressions(rootObject); return runHqlQuery(session, formatString, parameters, firstResult, maxResults); }
/** * Runs a SQL query against a session. The query is processed with an {@link OgnlSqlFormat}, so it can * access values from the OGNL context. * @param session the session * @param sql the query string * @return the results of the query as an Object[] (an array cell per column) */ public static List<Object[]> runSql(Session session, String sql) { OgnlHqlFormat hqlFormat = OgnlHqlFormat.create(sql); String formatString = hqlFormat.getFormatString(); Object[] parameters = hqlFormat.evaluateOgnlExpressions(null); return runSql(session, formatString, parameters); }
/** * Runs a SQL query against a session. The query is processed with an {@link OgnlSqlFormat}, so it can * access values from the OGNL context. * @param session the session * @param sql the query string * @return the results of the query as an Object[] (an array cell per column) */ public static List<Object[]> runSql(Session session, String sql) { OgnlHqlFormat hqlFormat = OgnlHqlFormat.create(sql); String formatString = hqlFormat.getFormatString(); Object[] parameters = hqlFormat.evaluateOgnlExpressions(null); return runSql(session, formatString, parameters); }
OgnlHqlFormat hqlFormat = OgnlHqlFormat.create(queryString); String formatString = hqlFormat.getFormatString(); Object[] parameters = hqlFormat.evaluateOgnlExpressions(rootObject);
OgnlHqlFormat hqlFormat = OgnlHqlFormat.create(queryString); String formatString = hqlFormat.getFormatString(); Object[] parameters = hqlFormat.evaluateOgnlExpressions(rootObject);
List<Object> result; PropertyAccessor[] keyProperties = table.getKeyProperties(); OgnlHqlFormat hqlFormat = OgnlHqlFormat.create(hqlQueryString); String formatString = hqlFormat.getFormatString(); Object[] ognlParameters = hqlFormat.evaluateOgnlExpressions(rootObject);
List<Object> result; PropertyAccessor[] keyProperties = table.getKeyProperties(); OgnlHqlFormat hqlFormat = OgnlHqlFormat.create(hqlQueryString); String formatString = hqlFormat.getFormatString(); Object[] ognlParameters = hqlFormat.evaluateOgnlExpressions(rootObject);