Refine search
public void initialize() { _kload = field.getKeyMapping().getHandler(). objectValueRequiresLoad(field.getKeyMapping()); _vload = field.getElementMapping().getHandler(). objectValueRequiresLoad(field.getElementMapping()); }
public void initialize() { _kload = field.getKeyMapping().getHandler(). objectValueRequiresLoad(field.getKeyMapping()); _vload = field.getElementMapping().getHandler(). objectValueRequiresLoad(field.getElementMapping()); }
public void initialize() { _kload = field.getKeyMapping().getHandler(). objectValueRequiresLoad(field.getKeyMapping()); _vload = field.getElementMapping().getHandler(). objectValueRequiresLoad(field.getElementMapping()); }
public void initialize() { _kload = field.getKeyMapping().getHandler(). objectValueRequiresLoad(field.getKeyMapping()); _vload = field.getElementMapping().getHandler(). objectValueRequiresLoad(field.getElementMapping()); }
public void initialize() { _kload = field.getKeyMapping().getHandler(). objectValueRequiresLoad(field.getKeyMapping()); _vload = field.getElementMapping().getHandler(). objectValueRequiresLoad(field.getElementMapping()); }
private void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm, Map map) throws SQLException { if (map == null || map.isEmpty()) return; Row row = rm.getSecondaryRow(field.getTable(), Row.ACTION_INSERT); row.setForeignKey(field.getJoinForeignKey(), field.getJoinColumnIO(), sm); ValueMapping key = field.getKeyMapping(); ValueMapping val = field.getElementMapping(); Map.Entry entry; for (Iterator itr = map.entrySet().iterator(); itr.hasNext();) { entry = (Map.Entry) itr.next(); HandlerStrategies.set(key, entry.getKey(), store, row, _kcols, _kio, true); HandlerStrategies.set(val, entry.getValue(), store, row, _vcols, _vio, true); rm.flushSecondaryRow(row); } }
private void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm, Map map) throws SQLException { if (map == null || map.isEmpty()) return; Row row = rm.getSecondaryRow(field.getTable(), Row.ACTION_INSERT); row.setForeignKey(field.getJoinForeignKey(), field.getJoinColumnIO(), sm); ValueMapping key = field.getKeyMapping(); ValueMapping val = field.getElementMapping(); Map.Entry entry; for (Iterator itr = map.entrySet().iterator(); itr.hasNext();) { entry = (Map.Entry) itr.next(); HandlerStrategies.set(key, entry.getKey(), store, row, _kcols, _kio, true); HandlerStrategies.set(val, entry.getValue(), store, row, _vcols, _vio, true); rm.flushSecondaryRow(row); } }
private void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm, Map map) throws SQLException { if (map == null || map.isEmpty()) return; Row row = rm.getSecondaryRow(field.getTable(), Row.ACTION_INSERT); row.setForeignKey(field.getJoinForeignKey(), field.getJoinColumnIO(), sm); ValueMapping val = field.getElementMapping(); ValueMapping key = field.getKeyMapping(); StoreContext ctx = store.getContext(); OpenJPAStateManager keysm; Map.Entry entry; for (Iterator itr = map.entrySet().iterator(); itr.hasNext();) { entry = (Map.Entry) itr.next(); keysm = RelationStrategies.getStateManager(entry.getKey(), ctx); key.setForeignKey(row, keysm); HandlerStrategies.set(val, entry.getValue(), store, row, _vcols, _vio, true); rm.flushSecondaryRow(row); } }
private void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm, Map map) throws SQLException { if (map == null || map.isEmpty()) return; Row row = rm.getSecondaryRow(field.getTable(), Row.ACTION_INSERT); row.setForeignKey(field.getJoinForeignKey(), field.getJoinColumnIO(), sm); ValueMapping val = field.getElementMapping(); ValueMapping key = field.getKeyMapping(); StoreContext ctx = store.getContext(); OpenJPAStateManager keysm; Map.Entry entry; for (Iterator itr = map.entrySet().iterator(); itr.hasNext();) { entry = (Map.Entry) itr.next(); keysm = RelationStrategies.getStateManager(entry.getKey(), ctx); key.setForeignKey(row, keysm); HandlerStrategies.set(val, entry.getValue(), store, row, _vcols, _vio, true); rm.flushSecondaryRow(row); } }
/** * Copy mapping info from the given instance to this one. */ public void copyMappingInfo(FieldMapping fm) { setMappedBy(fm.getMappedBy()); _info.copy(fm.getMappingInfo()); _val.copyMappingInfo(fm.getValueMapping()); _key.copyMappingInfo(fm.getKeyMapping()); _elem.copyMappingInfo(fm.getElementMapping()); }
/** * Copy mapping info from the given instance to this one. */ public void copyMappingInfo(FieldMapping fm) { setMappedBy(fm.getMappedBy()); _info.copy(fm.getMappingInfo()); _val.copyMappingInfo(fm.getValueMapping()); _key.copyMappingInfo(fm.getKeyMapping()); _elem.copyMappingInfo(fm.getElementMapping()); }
/** * Copy mapping info from the given instance to this one. */ public void copyMappingInfo(FieldMapping fm) { setMappedBy(fm.getMappedBy()); _info.copy(fm.getMappingInfo()); _val.copyMappingInfo(fm.getValueMapping()); _key.copyMappingInfo(fm.getKeyMapping()); _elem.copyMappingInfo(fm.getElementMapping()); }
/** * Copy mapping info from the given instance to this one. */ public void copyMappingInfo(FieldMapping fm) { setMappedBy(fm.getMappedBy()); _info.copy(fm.getMappingInfo()); _val.copyMappingInfo(fm.getValueMapping()); _key.copyMappingInfo(fm.getKeyMapping()); _elem.copyMappingInfo(fm.getElementMapping()); }
private void updateSetNull(OpenJPAStateManager sm, Object mkey, JDBCStore store, RowManager rm) throws SQLException { ValueMapping key = field.getKeyMapping(); ValueMapping val = field.getElementMapping(); StoreContext ctx = store.getContext(); ValueMappingInfo vinfo = field.getElementMapping().getValueInfo(); Table table = vinfo.getTable(val); ForeignKey joinFK = field.getMappingInfo().getJoinForeignKey(field, table, true); Row delRow = rm.getRow(field.getElementMapping().getDeclaredTypeMapping().getTable(), Row.ACTION_UPDATE, sm, true); delRow.whereForeignKey(joinFK, sm); val.setForeignKey(delRow, null); HandlerStrategies.set(key, null, store, delRow, _kcols, _kio, true); HandlerStrategies.where(key, mkey, store, delRow, _kcols); } }
/** * Copy mapping info from the given instance to this one. */ public void copyMappingInfo(FieldMapping fm) { setMappedBy(fm.getMappedBy()); _info.copy(fm.getMappingInfo()); _val.copyMappingInfo(fm.getValueMapping()); _key.copyMappingInfo(fm.getKeyMapping()); _elem.copyMappingInfo(fm.getElementMapping()); }
private void updateSetNull(OpenJPAStateManager sm, Object mkey, JDBCStore store, RowManager rm) throws SQLException { ValueMapping key = field.getKeyMapping(); ValueMapping val = field.getElementMapping(); StoreContext ctx = store.getContext(); ValueMappingInfo vinfo = field.getElementMapping().getValueInfo(); Table table = vinfo.getTable(val); ForeignKey joinFK = field.getMappingInfo().getJoinForeignKey(field, table, true); Row delRow = rm.getRow(field.getElementMapping().getDeclaredTypeMapping().getTable(), Row.ACTION_UPDATE, sm, true); delRow.whereForeignKey(joinFK, sm); val.setForeignKey(delRow, null); HandlerStrategies.set(key, null, store, delRow, _kcols, _kio, true); HandlerStrategies.where(key, mkey, store, delRow, _kcols); } }
public ClassMapping getClassMapping(ExpState state) { PathExpState pstate = (PathExpState) state; if (pstate.field == null) return _class; if (_key) { if (pstate.field.getKey().getTypeCode() == JavaTypes.PC) return pstate.field.getKeyMapping().getTypeMapping(); return null; } if (pstate.field.getElement().getTypeCode() == JavaTypes.PC) return pstate.field.getElementMapping().getTypeMapping(); if (pstate.field.getTypeCode() == JavaTypes.PC) return pstate.field.getTypeMapping(); return null; }
private void updateSetNull(OpenJPAStateManager sm, Object mkey, JDBCStore store, RowManager rm) throws SQLException { ValueMapping key = field.getKeyMapping(); ValueMapping val = field.getElementMapping(); StoreContext ctx = store.getContext(); ValueMappingInfo vinfo = field.getElementMapping().getValueInfo(); Table table = vinfo.getTable(val); ForeignKey joinFK = field.getMappingInfo().getJoinForeignKey(field, table, true); Row delRow = rm.getRow(field.getElementMapping().getDeclaredTypeMapping().getTable(), Row.ACTION_UPDATE, sm, true); delRow.whereForeignKey(joinFK, sm); val.setForeignKey(delRow, null); HandlerStrategies.set(key, null, store, delRow, _kcols, _kio, true); HandlerStrategies.where(key, mkey, store, delRow, _kcols); } }
private void updateSetNull(OpenJPAStateManager sm, Object mkey, JDBCStore store, RowManager rm) throws SQLException { ValueMapping key = field.getKeyMapping(); ValueMapping val = field.getElementMapping(); StoreContext ctx = store.getContext(); ValueMappingInfo vinfo = field.getElementMapping().getValueInfo(); Table table = vinfo.getTable(val); ForeignKey joinFK = field.getMappingInfo().getJoinForeignKey(field, table, true); Row delRow = rm.getRow(field.getElementMapping().getDeclaredTypeMapping().getTable(), Row.ACTION_UPDATE, sm, true); delRow.whereForeignKey(joinFK, sm); val.setForeignKey(delRow, null); HandlerStrategies.set(key, null, store, delRow, _kcols, _kio, true); HandlerStrategies.where(key, mkey, store, delRow, _kcols); } }
public void select(Select sel, int idx) { if (field.isUni1ToMFK()) { sel.orderBy(field.getKeyMapping().getColumns(), true, true); sel.select(vals[idx], field.getElementMapping(). getSelectSubclasses(), store, fetch, eagerMode, null); sel.whereForeignKey(field.getElementMapping().getForeignKey(), sm.getObjectId(), field.getElementMapping().getDeclaredTypeMapping(), store); } else { sel.whereForeignKey(field.getJoinForeignKey(), sm.getObjectId(), field.getDefiningMapping(), store); // order before select in case we're faking union with // multiple selects; order vals used to merge results Joins joins = joinValueRelation(sel.newJoins(), vals[idx]); sel.orderBy(field.getKeyMapping().getColumns(), true, true); sel.select(vals[idx], field.getElementMapping(). getSelectSubclasses(), store, fetch, eagerMode, joins); //### cheat: result joins only care about the relation path; //### thus we can use first mapping of union only if (idx == 0) resJoins[1] = joins; } } });