/** * Constructor. * * @param res the result data */ public MappedQueryResultObjectProvider(QueryResultMapping map, JDBCStore store, JDBCFetchConfiguration fetch, Result res) { _map = map; _store = store; _fetch = (fetch == null) ? store.getFetchConfiguration() : fetch; _mres = new MappingResult(res); }
public boolean absolute(int pos) throws SQLException { return _mres.absolute(pos); }
public void close() { _mres.close(); }
public Object getResultObject() throws SQLException { QueryResultMapping.PCResult[] pcs = _map.getPCResults(); Object[] cols = _map.getColumnResults(); // single object cases if (pcs.length == 0 && cols.length == 1) return _mres.getObject(cols[0], JavaSQLTypes.JDBC_DEFAULT, null); if (pcs.length == 1 && cols.length == 0) return _mres.load(pcs[0], _store, _fetch); // multiple objects Object[] ret = new Object[pcs.length + cols.length]; for (int i = 0; i < pcs.length; i++) ret[i] = _mres.load(pcs[i], _store, _fetch); for (int i = 0; i < cols.length; i++) ret[pcs.length + i] = _mres.getObject(cols[i], JavaSQLTypes.JDBC_DEFAULT, null); return ret; }
public Object getResultObject() throws SQLException { QueryResultMapping.PCResult[] pcs = _map.getPCResults(); Object[] cols = _map.getColumnResults(); // single object cases if (pcs.length == 0 && cols.length == 1) return _mres.getObject(cols[0], JavaSQLTypes.JDBC_DEFAULT, null); if (pcs.length == 1 && cols.length == 0) return _mres.load(pcs[0], _store, _fetch); // multiple objects Object[] ret = new Object[pcs.length + cols.length]; for (int i = 0; i < pcs.length; i++) ret[i] = _mres.load(pcs[i], _store, _fetch); for (int i = 0; i < cols.length; i++) ret[pcs.length + i] = _mres.getObject(cols[i], JavaSQLTypes.JDBC_DEFAULT, null); return ret; }
public Object getResultObject() throws SQLException { QueryResultMapping.PCResult[] pcs = _map.getPCResults(); Object[] cols = _map.getColumnResults(); // single object cases if (pcs.length == 0 && cols.length == 1) return _mres.getObject(cols[0], JavaSQLTypes.JDBC_DEFAULT, null); if (pcs.length == 1 && cols.length == 0) return _mres.load(pcs[0], _store, _fetch); // multiple objects Object[] ret = new Object[pcs.length + cols.length]; for (int i = 0; i < pcs.length; i++) ret[i] = _mres.load(pcs[i], _store, _fetch); for (int i = 0; i < cols.length; i++) ret[pcs.length + i] = _mres.getObject(cols[i], JavaSQLTypes.JDBC_DEFAULT, null); return ret; }
public Object getResultObject() throws SQLException { QueryResultMapping.PCResult[] pcs = _map.getPCResults(); Object[] cols = _map.getColumnResults(); // single object cases if (pcs.length == 0 && cols.length == 1) return _mres.getObject(cols[0], JavaSQLTypes.JDBC_DEFAULT, null); if (pcs.length == 1 && cols.length == 0) return _mres.load(pcs[0], _store, _fetch); // multiple objects Object[] ret = new Object[pcs.length + cols.length]; for (int i = 0; i < pcs.length; i++) ret[i] = _mres.load(pcs[i], _store, _fetch); for (int i = 0; i < cols.length; i++) ret[pcs.length + i] = _mres.getObject(cols[i], JavaSQLTypes.JDBC_DEFAULT, null); return ret; }
public Object getResultObject() throws SQLException { QueryResultMapping.PCResult[] pcs = _map.getPCResults(); Object[] cols = _map.getColumnResults(); // single object cases if (pcs.length == 0 && cols.length == 1) return _mres.getObject(cols[0], JavaSQLTypes.JDBC_DEFAULT, null); if (pcs.length == 1 && cols.length == 0) return _mres.load(pcs[0], _store, _fetch); // multiple objects Object[] ret = new Object[pcs.length + cols.length]; for (int i = 0; i < pcs.length; i++) ret[i] = _mres.load(pcs[i], _store, _fetch); for (int i = 0; i < cols.length; i++) ret[pcs.length + i] = _mres.getObject(cols[i], JavaSQLTypes.JDBC_DEFAULT, null); return ret; }
/** * Load an instance of the given type. Should be used in place of * {@link Result#load}. */ public Object load(QueryResultMapping.PCResult pc, JDBCStore store, JDBCFetchConfiguration fetch) throws SQLException { _pc = pc; try { return load(pc.getCandidateTypeMapping(), store, fetch); } finally { _pc = null; } }
/** * Load an instance of the given type. Should be used in place of * {@link Result#load}. */ public Object load(QueryResultMapping.PCResult pc, JDBCStore store, JDBCFetchConfiguration fetch) throws SQLException { _pc = pc; try { return load(pc.getCandidateTypeMapping(), store, fetch); } finally { _pc = null; } }
protected boolean containsInternal(Object obj, Joins joins) throws SQLException { return _res.contains(translate(obj, joins)); }
public boolean next() throws SQLException { return _mres.next(); }
public boolean absolute(int pos) throws SQLException { return _mres.absolute(pos); }
public boolean absolute(int pos) throws SQLException { return _mres.absolute(pos); }
public boolean next() throws SQLException { return _mres.next(); }
public boolean next() throws SQLException { return _mres.next(); }
protected boolean containsInternal(Object obj, Joins joins) throws SQLException { return _res.contains(translate(obj, joins)); }
public boolean absolute(int pos) throws SQLException { return _mres.absolute(pos); }
public boolean next() throws SQLException { return _mres.next(); }
public boolean absolute(int pos) throws SQLException { return _mres.absolute(pos); }