public void loadEagerJoin(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException { ClassMapping cls = field.getIndependentTypeMappings()[0]; sm.storeObject(field.getIndex(), res.load(cls, store, fetch, eagerJoin(res.newJoins(), cls, false))); }
public void selectEagerJoin(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { // limit the eager mode to single on recursive eager fetching b/c // at this point the select has been modified and an attempt to // clone it for a to-many eager select can result in a clone that // produces invalid SQL ClassMapping cls = field.getIndependentTypeMappings()[0]; boolean forceInner = fetch.hasFetchInnerJoin(field.getFullName(false)) ? true : false; sel.select(cls, field.getSelectSubclasses(), store, fetch, JDBCFetchConfiguration.EAGER_JOIN, eagerJoin(sel.newJoins(), cls, forceInner)); }
/** * Perform an eager parallel select. */ private void selectEagerParallel(Select sel, ClassMapping cls, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { sel.selectPrimaryKey(field.getDefiningMapping()); // set a variable name that does not conflict with any in the query; // using a variable guarantees that the selected data will use different // aliases and joins than any existing WHERE conditions on this field // that might otherwise limit the relations that match Joins joins = sel.newJoins().setVariable("*"); eagerJoin(joins, cls, true); sel.select(cls, field.getSelectSubclasses(), store, fetch, eagerMode, joins); }
/** * Process the given batched result. */ private Map processEagerParallelResult(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException { // do same joins as for load //### cheat: we know typical result joins only care about the relation //### path; thus we can ignore different mappings ClassMapping[] clss = field.getIndependentTypeMappings(); Joins joins = res.newJoins().setVariable("*"); eagerJoin(joins, clss[0], true); Map rels = new HashMap(); ClassMapping owner = field.getDefiningMapping(); ClassMapping cls; Object oid; while (res.next()) { cls = res.getBaseMapping(); if (cls == null) cls = clss[0]; oid = owner.getObjectId(store, res, null, true, null); rels.put(oid, res.load(cls, store, fetch, joins)); } res.close(); return rels; }
/** * Process the given batched result. */ private Map processEagerParallelResult(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException { // do same joins as for load //### cheat: we know typical result joins only care about the relation //### path; thus we can ignore different mappings ClassMapping[] clss = field.getIndependentTypeMappings(); Joins joins = res.newJoins().setVariable("*"); eagerJoin(joins, clss[0], true); Map rels = new HashMap(); ClassMapping owner = field.getDefiningMapping(); ClassMapping cls; Object oid; while (res.next()) { cls = res.getBaseMapping(); if (cls == null) cls = clss[0]; oid = owner.getObjectId(store, res, null, true, null); rels.put(oid, res.load(cls, store, fetch, joins)); } res.close(); return rels; }
public void selectEagerJoin(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (field.isBiMTo1JT()) return; // limit the eager mode to single on recursive eager fetching b/c // at this point the select has been modified and an attempt to // clone it for a to-many eager select can result in a clone that // produces invalid SQL ClassMapping cls = field.getIndependentTypeMappings()[0]; boolean forceInner = fetch.hasFetchInnerJoin(field.getFullName(false)) ? true : false; sel.select(cls, field.getSelectSubclasses(), store, fetch, JDBCFetchConfiguration.EAGER_JOIN, eagerJoin(sel.newJoins(), cls, forceInner)); }
/** * Process the given batched result. */ private Map processEagerParallelResult(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException { // do same joins as for load //### cheat: we know typical result joins only care about the relation //### path; thus we can ignore different mappings ClassMapping[] clss = field.getIndependentTypeMappings(); Joins joins = res.newJoins().setVariable("*"); eagerJoin(joins, clss[0], true); Map rels = new HashMap(); ClassMapping owner = field.getDefiningMapping(); ClassMapping cls; Object oid; while (res.next()) { cls = res.getBaseMapping(); if (cls == null) cls = clss[0]; oid = owner.getObjectId(store, res, null, true, null); rels.put(oid, res.load(cls, store, fetch, joins)); } res.close(); return rels; }
/** * Process the given batched result. */ private Map processEagerParallelResult(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException { // do same joins as for load //### cheat: we know typical result joins only care about the relation //### path; thus we can ignore different mappings ClassMapping[] clss = field.getIndependentTypeMappings(); Joins joins = res.newJoins().setVariable("*"); eagerJoin(joins, clss[0], true); Map rels = new HashMap(); ClassMapping owner = field.getDefiningMapping(); ClassMapping cls; Object oid; while (res.next()) { cls = res.getBaseMapping(); if (cls == null) cls = clss[0]; oid = owner.getObjectId(store, res, null, true, null); rels.put(oid, res.load(cls, store, fetch, joins)); } res.close(); return rels; }
/** * Process the given batched result. */ private Map processEagerParallelResult(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, Result res) throws SQLException { // do same joins as for load //### cheat: we know typical result joins only care about the relation //### path; thus we can ignore different mappings ClassMapping[] clss = field.getIndependentTypeMappings(); Joins joins = res.newJoins().setVariable("*"); eagerJoin(joins, clss[0], true); Map rels = new HashMap(); ClassMapping owner = field.getDefiningMapping(); ClassMapping cls; Object oid; while (res.next()) { cls = res.getBaseMapping(); if (cls == null) cls = clss[0]; oid = owner.getObjectId(store, res, null, true, null); rels.put(oid, res.load(cls, store, fetch, joins)); } res.close(); return rels; }
public void selectEagerJoin(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (field.isBiMTo1JT()) return; // limit the eager mode to single on recursive eager fetching b/c // at this point the select has been modified and an attempt to // clone it for a to-many eager select can result in a clone that // produces invalid SQL ClassMapping cls = field.getIndependentTypeMappings()[0]; boolean forceInner = fetch.hasFetchInnerJoin(field.getFullName(false)) ? true : false; sel.select(cls, field.getSelectSubclasses(), store, fetch, JDBCFetchConfiguration.EAGER_JOIN, eagerJoin(sel.newJoins(), cls, forceInner)); }
/** * Perform an eager parallel select. */ private void selectEagerParallel(Select sel, ClassMapping cls, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (field.isBiMTo1JT()) return; sel.selectPrimaryKey(field.getDefiningMapping()); // set a variable name that does not conflict with any in the query; // using a variable guarantees that the selected data will use different // aliases and joins than any existing WHERE conditions on this field // that might otherwise limit the relations that match Joins joins = sel.newJoins().setVariable("*"); eagerJoin(joins, cls, true); sel.select(cls, field.getSelectSubclasses(), store, fetch, eagerMode, joins); }
public void selectEagerJoin(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (field.isBiMTo1JT()) return; // limit the eager mode to single on recursive eager fetching b/c // at this point the select has been modified and an attempt to // clone it for a to-many eager select can result in a clone that // produces invalid SQL ClassMapping cls = field.getIndependentTypeMappings()[0]; boolean forceInner = fetch.hasFetchInnerJoin(field.getFullName(false)) ? true : false; sel.select(cls, field.getSelectSubclasses(), store, fetch, JDBCFetchConfiguration.EAGER_JOIN, eagerJoin(sel.newJoins(), cls, forceInner)); }
public void selectEagerJoin(Select sel, OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (field.isBiMTo1JT()) return; // limit the eager mode to single on recursive eager fetching b/c // at this point the select has been modified and an attempt to // clone it for a to-many eager select can result in a clone that // produces invalid SQL ClassMapping cls = field.getIndependentTypeMappings()[0]; boolean forceInner = fetch.hasFetchInnerJoin(field.getFullName(false)) ? true : false; sel.select(cls, field.getSelectSubclasses(), store, fetch, JDBCFetchConfiguration.EAGER_JOIN, eagerJoin(sel.newJoins(), cls, forceInner)); }
/** * Perform an eager parallel select. */ private void selectEagerParallel(Select sel, ClassMapping cls, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (field.isBiMTo1JT()) return; sel.selectPrimaryKey(field.getDefiningMapping()); // set a variable name that does not conflict with any in the query; // using a variable guarantees that the selected data will use different // aliases and joins than any existing WHERE conditions on this field // that might otherwise limit the relations that match Joins joins = sel.newJoins().setVariable("*"); eagerJoin(joins, cls, true); sel.select(cls, field.getSelectSubclasses(), store, fetch, eagerMode, joins); }
/** * Perform an eager parallel select. */ private void selectEagerParallel(Select sel, ClassMapping cls, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (field.isBiMTo1JT()) return; sel.selectPrimaryKey(field.getDefiningMapping()); // set a variable name that does not conflict with any in the query; // using a variable guarantees that the selected data will use different // aliases and joins than any existing WHERE conditions on this field // that might otherwise limit the relations that match Joins joins = sel.newJoins().setVariable("*"); eagerJoin(joins, cls, true); sel.select(cls, field.getSelectSubclasses(), store, fetch, eagerMode, joins); }
/** * Perform an eager parallel select. */ private void selectEagerParallel(Select sel, ClassMapping cls, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode) { if (field.isBiMTo1JT()) return; sel.selectPrimaryKey(field.getDefiningMapping()); // set a variable name that does not conflict with any in the query; // using a variable guarantees that the selected data will use different // aliases and joins than any existing WHERE conditions on this field // that might otherwise limit the relations that match Joins joins = sel.newJoins().setVariable("*"); eagerJoin(joins, cls, true); sel.select(cls, field.getSelectSubclasses(), store, fetch, eagerMode, joins); }
res.setLocking(store.getLockManager().skipRelationFieldLock()); sm.storeObject(field.getIndex(), res.load(cls, store, fetch, eagerJoin(res.newJoins(), cls, false))); } finally { res.setLocking(isLocked);
res.setLocking(store.getLockManager().skipRelationFieldLock()); sm.storeObject(field.getIndex(), res.load(cls, store, fetch, eagerJoin(res.newJoins(), cls, false))); } finally { res.setLocking(isLocked);
res.setLocking(store.getLockManager().skipRelationFieldLock()); sm.storeObject(field.getIndex(), res.load(cls, store, fetch, eagerJoin(res.newJoins(), cls, false))); } finally { res.setLocking(isLocked);
res.setLocking(store.getLockManager().skipRelationFieldLock()); sm.storeObject(field.getIndex(), res.load(cls, store, fetch, eagerJoin(res.newJoins(), cls, false))); } finally { res.setLocking(isLocked);