/** * 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; }
/** * 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; }
protected boolean isTypeUnjoinedSubclass(ValueMapping mapped) { ClassMapping def = field.getDefiningMapping(); for (; def != null; def = def.getJoinablePCSuperclassMapping()) if (def == mapped.getTypeMapping()) return false; return true; }
private void insert(OpenJPAStateManager sm, RowManager rm, Object vals) throws SQLException { if (field.getMappedBy() != null && !_orderInsert && !_orderUpdate) return; Collection coll = toCollection(vals); if (coll == null || coll.isEmpty()) return; ClassMapping rel = field.getElementMapping().getTypeMapping(); int idx = 0; for (Iterator itr = coll.iterator(); itr.hasNext(); idx++) updateInverse(sm.getContext(), itr.next(), rel, rm, sm, idx); }
private void insert(OpenJPAStateManager sm, RowManager rm, Object vals) throws SQLException { if (field.getMappedBy() != null && !_orderInsert && !_orderUpdate) return; Collection coll = toCollection(vals); if (coll == null || coll.isEmpty()) return; ClassMapping rel = field.getElementMapping().getTypeMapping(); int idx = 0; for (Iterator itr = coll.iterator(); itr.hasNext(); idx++) updateInverse(sm.getContext(), itr.next(), rel, rm, sm, idx); }
private void insert(OpenJPAStateManager sm, RowManager rm, Object vals) throws SQLException { if (field.getMappedBy() != null && !_orderInsert && !_orderUpdate) return; Collection coll = toCollection(vals); if (coll == null || coll.isEmpty()) return; ClassMapping rel = field.getElementMapping().getTypeMapping(); int idx = 0; for (Iterator itr = coll.iterator(); itr.hasNext(); idx++) updateInverse(sm.getContext(), itr.next(), rel, rm, sm, idx); }
/** * Return true if we should use the generic untyped PC handler for the * given unmapped relation. */ private boolean useUntypedPCHandler(ValueMapping val) { ClassMapping rel = val.getTypeMapping(); return rel.getIdentityType() == ClassMapping.ID_UNKNOWN || (rel.getIdentityType() == ClassMapping.ID_APPLICATION && (rel.getPrimaryKeyFields().length == 0 || (!rel.isOpenJPAIdentity() && Modifier.isAbstract (rel.getObjectIdType().getModifiers())))); }
/** * Return true if we should use the generic untyped PC handler for the * given unmapped relation. */ private boolean useUntypedPCHandler(ValueMapping val) { ClassMapping rel = val.getTypeMapping(); return rel.getIdentityType() == ClassMapping.ID_UNKNOWN || (rel.getIdentityType() == ClassMapping.ID_APPLICATION && (rel.getPrimaryKeyFields().length == 0 || (!rel.isOpenJPAIdentity() && Modifier.isAbstract (rel.getObjectIdType().getModifiers())))); }
public Object toDataStoreValue(Object val, JDBCStore store) { ClassMapping cm = field.getElementMapping().getTypeMapping(); return cm.toDataStoreValue(val, cm.getPrimaryKeyColumns(), store); }
/** * Throw the proper exception if the given handler-controlled value * represents an unjoinable relation. */ public static void assertJoinable(ValueMapping vm) { ClassMapping rel = vm.getTypeMapping(); if (rel != null && (rel.getTable() == null || !rel.getTable().equals(vm.getFieldMapping().getTable()))) throw RelationStrategies.unjoinable(vm); } }
/** * Throw the proper exception if the given handler-controlled value * represents an unjoinable relation. */ public static void assertJoinable(ValueMapping vm) { ClassMapping rel = vm.getTypeMapping(); if (rel != null && (rel.getTable() == null || !rel.getTable().equals(vm.getFieldMapping().getTable()))) throw RelationStrategies.unjoinable(vm); } }
/** * Throw the proper exception if the given handler-controlled value * represents an unjoinable relation. */ public static void assertJoinable(ValueMapping vm) { ClassMapping rel = vm.getTypeMapping(); if (rel != null && (rel.getTable() == null || !rel.getTable().equals(vm.getFieldMapping().getTable()))) throw RelationStrategies.unjoinable(vm); } }
/** * Throw the proper exception if the given handler-controlled value * represents an unjoinable relation. */ public static void assertJoinable(ValueMapping vm) { ClassMapping rel = vm.getTypeMapping(); if (rel != null && (rel.getTable() == null || !rel.getTable().equals(vm.getFieldMapping().getTable()))) throw RelationStrategies.unjoinable(vm); } }
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); }
/** * Map the given value's join to its persistent type. */ private void mapTypeJoin(ValueMapping vm, DBIdentifier name, boolean adapt) { if (vm.getTypeMapping().isMapped()) { ValueMappingInfo vinfo = vm.getValueInfo(); ForeignKey fk = vinfo.getTypeJoin(vm, name, false, adapt); vm.setForeignKey(fk); vm.setColumnIO(vinfo.getColumnIO()); } else RelationStrategies.mapRelationToUnmappedPC(vm, name, adapt); vm.mapConstraints(name, adapt); }
public static void mapRelationToUnmappedPC(ValueMapping vm, DBIdentifier name, boolean adapt) { if (vm.getTypeMapping().getIdentityType() == ClassMapping.ID_UNKNOWN) throw new MetaDataException(_loc.get("rel-to-unknownid", vm)); ValueMappingInfo vinfo = vm.getValueInfo(); Column[] tmplates = newUnmappedPCTemplateColumns(vm, name); vm.setColumns(vinfo.getColumns(vm, name, tmplates, vm.getFieldMapping().getTable(), adapt)); vm.setColumnIO(vinfo.getColumnIO()); }
public static void mapRelationToUnmappedPC(ValueMapping vm, DBIdentifier name, boolean adapt) { if (vm.getTypeMapping().getIdentityType() == ClassMapping.ID_UNKNOWN) throw new MetaDataException(_loc.get("rel-to-unknownid", vm)); ValueMappingInfo vinfo = vm.getValueInfo(); Column[] tmplates = newUnmappedPCTemplateColumns(vm, name); vm.setColumns(vinfo.getColumns(vm, name, tmplates, vm.getFieldMapping().getTable(), adapt)); vm.setColumnIO(vinfo.getColumnIO()); }
public static void mapRelationToUnmappedPC(ValueMapping vm, DBIdentifier name, boolean adapt) { if (vm.getTypeMapping().getIdentityType() == ClassMapping.ID_UNKNOWN) throw new MetaDataException(_loc.get("rel-to-unknownid", vm)); ValueMappingInfo vinfo = vm.getValueInfo(); Column[] tmplates = newUnmappedPCTemplateColumns(vm, name); vm.setColumns(vinfo.getColumns(vm, name, tmplates, vm.getFieldMapping().getTable(), adapt)); vm.setColumnIO(vinfo.getColumnIO()); }