/** * @see org.seasar.framework.jpa.metadata.AttributeDesc#isAssociation() */ public boolean isAssociation() { if (fieldMetaData instanceof FieldMapping) { FieldStrategy strategy = FieldMapping.class.cast(fieldMetaData).getStrategy(); return strategy instanceof RelationFieldStrategy || strategy instanceof ContainerFieldStrategy; } return false; }
private Object loadEmbeddedMapKey(ExpContext ctx, ExpState state, Result res) throws SQLException { PathExpState pstate = (PathExpState) state; validateMapStrategy(pstate.field.getStrategy()); LRSMapFieldStrategy strategy = (LRSMapFieldStrategy) pstate.field.getStrategy(); return strategy.loadKey(null, ctx.store, ctx.fetch, res, pstate.joins); }
private Object loadEmbeddedMapKey(ExpContext ctx, ExpState state, Result res) throws SQLException { PathExpState pstate = (PathExpState) state; validateMapStrategy(pstate.field.getStrategy()); LRSMapFieldStrategy strategy = (LRSMapFieldStrategy) pstate.field.getStrategy(); return strategy.loadKey(null, ctx.store, ctx.fetch, res, pstate.joins); }
private Object loadEmbeddedMapKey(ExpContext ctx, ExpState state, Result res) throws SQLException { PathExpState pstate = (PathExpState) state; validateMapStrategy(pstate.field.getStrategy()); LRSMapFieldStrategy strategy = (LRSMapFieldStrategy) pstate.field.getStrategy(); return strategy.loadKey(null, ctx.store, ctx.fetch, res, pstate.joins); }
private Object loadEmbeddedMapKey(ExpContext ctx, ExpState state, Result res) throws SQLException { PathExpState pstate = (PathExpState) state; validateMapStrategy(pstate.field.getStrategy()); LRSMapFieldStrategy strategy = (LRSMapFieldStrategy) pstate.field.getStrategy(); return strategy.loadKey(null, ctx.store, ctx.fetch, res, pstate.joins); }
private void selectEmbeddedMapKey(Select sel, ExpContext ctx, ExpState state) { PathExpState pstate = (PathExpState) state; validateMapStrategy(pstate.field.getStrategy()); LRSMapFieldStrategy strategy = (LRSMapFieldStrategy) pstate.field.getStrategy(); ClassMapping mapping = pstate.field.getKeyMapping().getTypeMapping(); strategy.selectKey(sel, mapping, null, ctx.store, ctx.fetch, pstate.joins); }
private void selectEmbeddedMapKey(Select sel, ExpContext ctx, ExpState state) { PathExpState pstate = (PathExpState) state; validateMapStrategy(pstate.field.getStrategy()); LRSMapFieldStrategy strategy = (LRSMapFieldStrategy) pstate.field.getStrategy(); ClassMapping mapping = pstate.field.getKeyMapping().getTypeMapping(); strategy.selectKey(sel, mapping, null, ctx.store, ctx.fetch, pstate.joins); }
private void selectEmbeddedMapKey(Select sel, ExpContext ctx, ExpState state) { PathExpState pstate = (PathExpState) state; validateMapStrategy(pstate.field.getStrategy()); LRSMapFieldStrategy strategy = (LRSMapFieldStrategy) pstate.field.getStrategy(); ClassMapping mapping = pstate.field.getKeyMapping().getTypeMapping(); strategy.selectKey(sel, mapping, null, ctx.store, ctx.fetch, pstate.joins); }
private void selectEmbeddedMapKey(Select sel, ExpContext ctx, ExpState state) { PathExpState pstate = (PathExpState) state; validateMapStrategy(pstate.field.getStrategy()); LRSMapFieldStrategy strategy = (LRSMapFieldStrategy) pstate.field.getStrategy(); ClassMapping mapping = pstate.field.getKeyMapping().getTypeMapping(); strategy.selectKey(sel, mapping, null, ctx.store, ctx.fetch, pstate.joins); }
/** * Recursive helper. */ private Object toRelationDataStoreValue(OpenJPAStateManager sm, Column col, int idx) { FieldMapping field = findField(col, idx); if (field == null) throw new InternalException(); if (field.getHandler() instanceof RelationId) return ((RelationId) field.getStrategy()). toRelationDataStoreValue(sm, col); if (field.getStrategy() instanceof RelationId) return ((RelationId) field.getStrategy()). toRelationDataStoreValue(sm, col); return toRelationDataStoreValue(sm, col, field.getIndex() + 1); }
/** * Recursive helper. */ private Object toRelationDataStoreValue(OpenJPAStateManager sm, Column col, int idx) { FieldMapping field = findField(col, idx); if (field == null) throw new InternalException(); if (field.getHandler() instanceof RelationId) return ((RelationId) field.getStrategy()). toRelationDataStoreValue(sm, col); if (field.getStrategy() instanceof RelationId) return ((RelationId) field.getStrategy()). toRelationDataStoreValue(sm, col); return toRelationDataStoreValue(sm, col, field.getIndex() + 1); }
/** * Synchronize internal mapping strategy information with the given field. */ public void syncStrategy(FieldMapping field) { setStrategy(null); if (field.getHandler() != null || field.getStrategy() == null) return; // explicit strategy if the strategy isn't the expected default Strategy strat = field.getMappingRepository().defaultStrategy (field, false); if (strat == null || !strat.getAlias().equals(field.getAlias())) setStrategy(field.getAlias()); }
/** * Synchronize internal mapping strategy information with the given field. */ public void syncStrategy(FieldMapping field) { setStrategy(null); if (field.getHandler() != null || field.getStrategy() == null) return; // explicit strategy if the strategy isn't the expected default Strategy strat = field.getMappingRepository().defaultStrategy (field, false); if (strat == null || !strat.getAlias().equals(field.getAlias())) setStrategy(field.getAlias()); }
/** * Synchronize internal mapping strategy information with the given field. */ public void syncStrategy(FieldMapping field) { setStrategy(null); if (field.getHandler() != null || field.getStrategy() == null) return; // explicit strategy if the strategy isn't the expected default Strategy strat = field.getMappingRepository().defaultStrategy (field, false); if (strat == null || !strat.getAlias().equals(field.getAlias())) setStrategy(field.getAlias()); }
/** * Synchronize internal mapping strategy information with the given field. */ public void syncStrategy(FieldMapping field) { setStrategy(null); if (field.getHandler() != null || field.getStrategy() == null) return; // explicit strategy if the strategy isn't the expected default Strategy strat = field.getMappingRepository().defaultStrategy (field, false); if (strat == null || !strat.getAlias().equals(field.getAlias())) setStrategy(field.getAlias()); }
protected void lockJoinTables(List<SQLBuffer> sqls, DBDictionary dict, Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory) { FieldMapping[] fms = mapping.getFieldMappings(); for (int i = 0; i < fms.length; i++) { Strategy strat = fms[i].getStrategy(); if (strat instanceof ContainerFieldStrategy) { ForeignKey fk = ((ContainerFieldStrategy)strat).getJoinForeignKey(); Select select = factory.newSelect(); select.select(fk.getColumns()); select.whereForeignKey(fk, id, fms[i].getDefiningMapping(), _store); sqls.add(select.toSelect(true, fetch)); } } }
protected void lockJoinTables(List<SQLBuffer> sqls, DBDictionary dict, Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory) { FieldMapping[] fms = mapping.getFieldMappings(); for (int i = 0; i < fms.length; i++) { Strategy strat = fms[i].getStrategy(); if (strat instanceof ContainerFieldStrategy) { ForeignKey fk = ((ContainerFieldStrategy)strat).getJoinForeignKey(); Select select = factory.newSelect(); select.select(fk.getColumns()); select.whereForeignKey(fk, id, fms[i].getDefiningMapping(), _store); sqls.add(select.toSelect(true, fetch)); } } }
/** * Synchronize internal mapping strategy information with the given field. */ public void syncStrategy(FieldMapping field) { setStrategy(null); if (field.getHandler() != null || field.getStrategy() == null) return; // explicit strategy if the strategy isn't the expected default Strategy strat = field.getMappingRepository().defaultStrategy (field, false); if (strat == null || !strat.getAlias().equals(field.getAlias())) setStrategy(field.getAlias()); }
protected void lockJoinTables(List<SQLBuffer> sqls, DBDictionary dict, Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory) { FieldMapping[] fms = mapping.getFieldMappings(); for (int i = 0; i < fms.length; i++) { Strategy strat = fms[i].getStrategy(); if (strat instanceof ContainerFieldStrategy) { ForeignKey fk = ((ContainerFieldStrategy)strat).getJoinForeignKey(); Select select = factory.newSelect(); select.select(fk.getColumns()); select.whereForeignKey(fk, id, fms[i].getDefiningMapping(), _store); sqls.add(select.toSelect(true, fetch)); } } }
protected void lockJoinTables(List<SQLBuffer> sqls, DBDictionary dict, Object id, ClassMapping mapping, JDBCFetchConfiguration fetch, SQLFactory factory) { FieldMapping[] fms = mapping.getFieldMappings(); for (int i = 0; i < fms.length; i++) { Strategy strat = fms[i].getStrategy(); if (strat instanceof ContainerFieldStrategy) { ForeignKey fk = ((ContainerFieldStrategy)strat).getJoinForeignKey(); Select select = factory.newSelect(); select.select(fk.getColumns()); select.whereForeignKey(fk, id, fms[i].getDefiningMapping(), _store); sqls.add(select.toSelect(true, fetch)); } } }