/** * Constructor. */ public ResultSetResult(Connection conn, Statement stmnt, ResultSet rs, JDBCStore store) { this(conn, stmnt, rs, store.getDBDictionary()); setStore(store); }
/** * JDBC 2 constructor. Relies on being able to retrieve the statement * from the result set, and the connection from the statement. */ public ResultSetResult(ResultSet rs, JDBCStore store) throws SQLException { this(rs, store.getDBDictionary()); setStore(store); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { if (Timestamp.class.isAssignableFrom(_type)) { sql.append(ctx.store.getDBDictionary().currentTimestampFunction); } else if (Time.class.isAssignableFrom(_type)) { sql.append(ctx.store.getDBDictionary().currentTimeFunction); } else if (Date.class.isAssignableFrom(_type)) { sql.append(ctx.store.getDBDictionary().currentDateFunction); } else { throw new InternalException(); } } }
public void handleCheckedException(Exception e) { if (e instanceof SQLException) throw SQLExceptions.getStore((SQLException) e, _store.getDBDictionary()); throw new StoreException(e); }
protected ExpressionFactory getExpressionFactory(ClassMetaData meta) { JDBCExpressionFactory factory = new JDBCExpressionFactory((ClassMapping) meta); if (_store.getDBDictionary() instanceof PostgresDictionary) factory.setBooleanLiteralAsNumeric(false); return factory; }
public boolean hasNext() { if (_next == null) { try { _next = (_res[0].next()) ? Boolean.TRUE : Boolean.FALSE; if (_next.booleanValue() && _res[1] != _res[0]) _res[1].next(); } catch (SQLException se) { throw SQLExceptions.getStore(se, _store.getDBDictionary()); } } return _next.booleanValue(); }
private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }
public boolean supportsEagerSelect(Select sel, OpenJPAStateManager sm, JDBCStore store, ClassMapping base, JDBCFetchConfiguration fetch) { return store.getDBDictionary().canOuterJoin(sel.getJoinSyntax(), cls.getJoinForeignKey()); } }
private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }
private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql, int index) { BinaryOpExpState bstate = (BinaryOpExpState) state; ctx.store.getDBDictionary().mathFunction(sql, _op, new FilterValueImpl(sel, ctx, bstate.state1, _val1), new FilterValueImpl(sel, ctx, bstate.state2, _val2)); }
private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }
/** * Constructor. Supply connection. */ public PreparedStatementManagerImpl(JDBCStore store, Connection conn) { _store = store; _dict = store.getDBDictionary(); _conn = conn; if (store.getConfiguration() != null) _log = store.getConfiguration().getLog(JDBCConfiguration.LOG_JDBC); }
public void handleCheckedException(Exception e) { if (e instanceof SQLException) throw SQLExceptions.getStore((SQLException) e, _store.getDBDictionary(), _fetch.getReadLockLevel()); throw new StoreException(e); } }
public Object next() { if (!hasNext()) throw new NoSuchElementException(); try { _next = null; return _strat.loadElement(_sm, _store, _fetch, _res, _joins[_res.indexOf()]); } catch (SQLException se) { throw SQLExceptions.getStore(se, _store.getDBDictionary()); } }
private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }
public boolean supportsEagerSelect(Select sel, OpenJPAStateManager sm, JDBCStore store, ClassMapping base, JDBCFetchConfiguration fetch) { return store.getDBDictionary().canOuterJoin(sel.getJoinSyntax(), cls.getJoinForeignKey()); } }
private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }
private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }
private SQLBuffer newSQLBuffer(Select sel, ExpContext ctx, ExpState state) { calculateValue(sel, ctx, state, null, null); SQLBuffer buf = new SQLBuffer(ctx.store.getDBDictionary()); appendTo(sel, ctx, state, buf, 0); return buf; }