/** * Return whether our defining mapping is an unjoined subclass of * the type of the given value. */ private boolean isTypeUnjoinedSubclass(ValueMapping mapped) { ClassMapping def = field.getDefiningMapping(); for (; def != null; def = def.getJoinablePCSuperclassMapping()) if (def == mapped.getTypeMapping()) return false; return true; }
/** * Return whether our defining mapping is an unjoined subclass of * the type of the given value. */ private boolean isTypeUnjoinedSubclass(ValueMapping mapped) { ClassMapping def = field.getDefiningMapping(); for (; def != null; def = def.getJoinablePCSuperclassMapping()) if (def == mapped.getTypeMapping()) return false; return true; }
private ClassMapping getDefiningMapping(FieldMapping field) { ClassMapping clm = field.getDefiningMapping(); ValueMappingImpl value = (ValueMappingImpl)clm.getEmbeddingMetaData(); if (value == null) return clm; FieldMapping field1 = value.getFieldMapping(); return getDefiningMapping(field1); }
public void initialize() { // record whether we're using a state image indicator, which requires // that we do special null checks when loading primitives _stateImage = field.getDefiningMapping().getVersion().getStrategy(). getAlias().equals(StateComparisonVersionStrategy.ALIAS); if (_stateImage) field.setUsesImplData(null); }
private ClassMapping getDefiningMapping(FieldMapping field) { ClassMapping clm = field.getDefiningMapping(); ValueMappingImpl value = (ValueMappingImpl)clm.getEmbeddingMetaData(); if (value == null) return clm; FieldMapping field1 = value.getFieldMapping(); return getDefiningMapping(field1); }
public boolean isPrimaryKeyObjectId(boolean hasAll) { return cls.getEmbeddingMapping().getFieldMapping(). getDefiningMapping().isPrimaryKeyObjectId(hasAll); } }
public void initialize() { // record whether we're using a state image indicator, which requires // that we do special null checks when loading primitives _stateImage = field.getDefiningMapping().getVersion().getStrategy(). getAlias().equals(StateComparisonVersionStrategy.ALIAS); if (_stateImage) field.setUsesImplData(null); }
public void initialize() { // record whether we're using a state image indicator, which requires // that we do special null checks when loading primitives _stateImage = field.getDefiningMapping().getVersion().getStrategy(). getAlias().equals(StateComparisonVersionStrategy.ALIAS); if (_stateImage) field.setUsesImplData(null); }
private Select createSelect(OpenJPAStateManager sm, JDBCStore store) { Select sel = store.getSQLFactory().newSelect(); sel.select(field.getColumns()[0]); sel.selectPrimaryKey(field.getDefiningMapping()); sel.wherePrimaryKey (sm.getObjectId(), field.getDefiningMapping(), store); sel.setLob(true); return sel; }
private Select createSelect(OpenJPAStateManager sm, JDBCStore store) { Select sel = store.getSQLFactory().newSelect(); sel.select(field.getColumns()[0]); sel.selectPrimaryKey(field.getDefiningMapping()); sel.wherePrimaryKey (sm.getObjectId(), field.getDefiningMapping(), store); sel.setLob(true); return sel; }
public void select(Select sel, int idx) { ClassMapping elem = (elems.length == 0) ? null : elems[idx]; sel.whereForeignKey(_strat.getJoinForeignKey(elem), sm.getObjectId(), _strat.getFieldMapping(). getDefiningMapping(), store); } });
public void select(Select sel, int idx) { ClassMapping cls = (clss.length == 0) ? null : clss[idx]; sel.whereForeignKey(_strat.getJoinForeignKey(cls), sm.getObjectId(), _strat.getFieldMapping(). getDefiningMapping(), store); } });
private Select createSelect(OpenJPAStateManager sm, JDBCStore store) { Select sel = store.getSQLFactory().newSelect(); sel.select(field.getColumns()[0]); sel.selectPrimaryKey(field.getDefiningMapping()); sel.wherePrimaryKey (sm.getObjectId(), field.getDefiningMapping(), store); sel.setLob(true); return sel; }
public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException { // OPENJPA-662: Version fields have NoneFieldStrategy -- hence they // need special treatment if (isVersion()) { return getDefiningMapping().getVersion().load(null, store, res, joins); } return assertStrategy().loadProjection(store, fetch, res, joins); }
public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException { // OPENJPA-662: Version fields have NoneFieldStrategy -- hence they // need special treatment if (isVersion()) { return getDefiningMapping().getVersion().load(null, store, res, joins); } return assertStrategy().loadProjection(store, fetch, res, joins); }
/** * The mapping's primary table. */ public Table getTable() { if (_fk != null) return _fk.getTable(); if (_val.getForeignKey() != null) return _val.getForeignKey().getTable(); return getDefiningMapping().getTable(); }
public Object loadProjection(JDBCStore store, JDBCFetchConfiguration fetch, Result res, Joins joins) throws SQLException { // OPENJPA-662: Version fields have NoneFieldStrategy -- hence they // need special treatment if (isVersion()) { return getDefiningMapping().getVersion().load(null, store, res, joins); } return assertStrategy().loadProjection(store, fetch, res, joins); }
public Result[] getResults(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins[] joins, boolean lrs) throws SQLException { Select sel = store.getSQLFactory().newSelect(); sel.setLRS(lrs); sel.select(_kcols); sel.select(_vcols); sel.whereForeignKey(field.getJoinForeignKey(), sm.getObjectId(), field.getDefiningMapping(), store); Result res = sel.execute(store, fetch); return new Result[]{ res, res }; }
public Result[] getResults(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins[] joins, boolean lrs) throws SQLException { Select sel = store.getSQLFactory().newSelect(); sel.setLRS(lrs); sel.select(_kcols); sel.select(_vcols); sel.whereForeignKey(field.getJoinForeignKey(), sm.getObjectId(), field.getDefiningMapping(), store); Result res = sel.execute(store, fetch); return new Result[]{ res, res }; }
public Result[] getResults(OpenJPAStateManager sm, JDBCStore store, JDBCFetchConfiguration fetch, int eagerMode, Joins[] joins, boolean lrs) throws SQLException { Select sel = store.getSQLFactory().newSelect(); sel.setLRS(lrs); sel.select(_kcols); sel.select(_vcols); sel.whereForeignKey(field.getJoinForeignKey(), sm.getObjectId(), field.getDefiningMapping(), store); Result res = sel.execute(store, fetch); return new Result[]{ res, res }; }