/* */ {
/* 81 */ this.log.trace("executing dynamic-ql: " + args[0]);
/* */ }
/* */
/* 84 */ JDBCStoreManager2 manager = (JDBCStoreManager2)this.entity.getManager();
/* 85 */ QLCompiler compiler = new EJBQLToSQL92Compiler(manager.getCatalog());
/* */ try
/* */ {
/* 88 */ compiler.compileJBossQL((String)args[0], this.metadata.getMethod().getReturnType(), getParamTypes(args), this.metadata);
/* */ }
/* */ catch (Throwable t)
/* */ {
/* 96 */ this.log.error("Error compiling JBossQL statement '" + args[0] + "'", t);
/* 97 */ throw new FinderException("Error compiling JBossQL statement '" + args[0] + "'");
/* */ }
/* */
/* 100 */ String sql = compiler.getSQL();
/* */
/* 102 */ int offsetParam = compiler.getOffsetParam();
/* 103 */ int offsetValue = compiler.getOffsetValue();
/* 104 */ int limitParam = compiler.getLimitParam();
/* 105 */ int limitValue = compiler.getLimitValue();
/* */ AbstractQueryCommand.ResultReader resultReader;
/* */ AbstractQueryCommand.ResultReader resultReader;
/* 108 */ if (!compiler.isSelectEntity())
/* */ {
/* */ AbstractQueryCommand.ResultReader resultReader;
/* 110 */ if (compiler.isSelectField())
/* */ {
/* 112 */ resultReader = new AbstractQueryCommand.FieldReader((JDBCCMPFieldBridge2)compiler.getSelectField());
/* */ }
/* */ else
/* */ {
/* 116 */ resultReader = new AbstractQueryCommand.FunctionReader(compiler.getSelectFunction());
/* */ }
/* */ }
/* */ else
/* */ {
/* 121 */ resultReader = new AbstractQueryCommand.EntityReader((JDBCEntityBridge2)compiler.getSelectEntity(), compiler.isSelectDistinct());
/* */ }
/* */
/* 124 */ return AbstractQueryCommand.fetchCollection(this.entity, sql, toArray(compiler.getInputParameters()), AbstractQueryCommand.toInt(args, offsetParam, offsetValue), AbstractQueryCommand.toInt(args, limitParam, limitValue), new AbstractQueryCommand.EagerCollectionStrategy(this.collectionFactory, resultReader, this.log), schema, factory, (Object[])(Object[])args[1], this.log);
/* */ }