private BitSet excludeInverseRelation(ClassMapping mapping, ConnectionInfo info, BitSet exclude) { FieldMapping inverse = info.result.getMappedByFieldMapping(); if (inverse != null) { FieldMapping[] fms = mapping.getDefinedFieldMappings(); if (exclude == null) exclude = new BitSet(fms.length); for (int i = 0; i < fms.length; i++) { if (fms[i] == inverse) { exclude.set(fms[i].getIndex()); break; } } } return exclude; }
private BitSet excludeInverseRelation(ClassMapping mapping, ConnectionInfo info, BitSet exclude) { FieldMapping inverse = info.result.getMappedByFieldMapping(); if (inverse != null) { FieldMapping[] fms = mapping.getDefinedFieldMappings(); if (exclude == null) exclude = new BitSet(fms.length); for (int i = 0; i < fms.length; i++) { if (fms[i] == inverse) { exclude.set(fms[i].getIndex()); break; } } } return exclude; }
private BitSet excludeInverseRelation(ClassMapping mapping, ConnectionInfo info, BitSet exclude) { FieldMapping inverse = info.result.getMappedByFieldMapping(); if (inverse != null) { FieldMapping[] fms = mapping.getDefinedFieldMappings(); if (exclude == null) exclude = new BitSet(fms.length); for (int i = 0; i < fms.length; i++) { if (fms[i] == inverse) { exclude.set(fms[i].getIndex()); break; } } } return exclude; }
private BitSet excludeInverseRelation(ClassMapping mapping, ConnectionInfo info, BitSet exclude) { FieldMapping inverse = info.result.getMappedByFieldMapping(); if (inverse != null) { FieldMapping[] fms = mapping.getDefinedFieldMappings(); if (exclude == null) exclude = new BitSet(fms.length); for (int i = 0; i < fms.length; i++) { if (fms[i] == inverse) { exclude.set(fms[i].getIndex()); break; } } } return exclude; }
protected void initializeMapping() { super.initializeMapping(); FieldMapping[] fields = getDefinedFieldMappings(); for (int i = 0; i < fields.length; i++) fields[i].resolve(MODE_MAPPING_INIT); _discrim.resolve(MODE_MAPPING_INIT); _version.resolve(MODE_MAPPING_INIT); _strategy.initialize(); }
protected void initializeMapping() { super.initializeMapping(); FieldMapping[] fields = getDefinedFieldMappings(); for (int i = 0; i < fields.length; i++) fields[i].resolve(MODE_MAPPING_INIT); _discrim.resolve(MODE_MAPPING_INIT); _version.resolve(MODE_MAPPING_INIT); _strategy.initialize(); }
protected void initializeMapping() { super.initializeMapping(); FieldMapping[] fields = getDefinedFieldMappings(); for (int i = 0; i < fields.length; i++) fields[i].resolve(MODE_MAPPING_INIT); _discrim.resolve(MODE_MAPPING_INIT); _version.resolve(MODE_MAPPING_INIT); _strategy.initialize(); }
protected void initializeMapping() { super.initializeMapping(); FieldMapping[] fields = getDefinedFieldMappings(); for (int i = 0; i < fields.length; i++) fields[i].resolve(MODE_MAPPING_INIT); _discrim.resolve(MODE_MAPPING_INIT); _version.resolve(MODE_MAPPING_INIT); _strategy.initialize(); }
protected void initializeMapping() { super.initializeMapping(); FieldMapping[] fields = getDefinedFieldMappings(); for (int i = 0; i < fields.length; i++) fields[i].resolve(MODE_MAPPING_INIT); _discrim.resolve(MODE_MAPPING_INIT); _version.resolve(MODE_MAPPING_INIT); _strategy.initialize(); }
/** * Recursive method to update the given instance. */ protected void update(OpenJPAStateManager sm, BitSet dirty, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs) throws SQLException { Boolean custom = mapping.isCustomUpdate(sm, store); if (!Boolean.FALSE.equals(custom)) mapping.customUpdate(sm, store); if (Boolean.TRUE.equals(custom)) return; // update all fields before all mappings so that the mappings can // detect whether any fields in their rows have been modified FieldMapping[] fields = mapping.getDefinedFieldMappings(); for (int i = 0; i < fields.length; i++) { if (dirty.get(fields[i].getIndex()) && !bufferCustomUpdate(fields[i], sm, store, customs)) fields[i].update(sm, store, rowMgr); } ClassMapping sup = mapping.getJoinablePCSuperclassMapping(); if (sup == null) updateIndicators(sm, mapping, rowMgr, store, customs, false); else update(sm, dirty, sup, rowMgr, store, customs); mapping.update(sm, store, rowMgr); }
/** * Drops schema components that appear to be unused from the local * copy of the schema group. */ private void dropUnusedSchemaComponents(ClassMapping[] mappings) { FieldMapping[] fields; for (int i = 0; i < mappings.length; i++) { mappings[i].refSchemaComponents(); mappings[i].getDiscriminator().refSchemaComponents(); mappings[i].getVersion().refSchemaComponents(); fields = mappings[i].getDefinedFieldMappings(); for (int j = 0; j < fields.length; j++) fields[j].refSchemaComponents(); } // also allow the dbdictionary to ref any schema components that // it adds apart from mappings SchemaGroup group = getSchemaGroup(); Schema[] schemas = group.getSchemas(); Table[] tables; for (int i = 0; i < schemas.length; i++) { tables = schemas[i].getTables(); for (int j = 0; j < tables.length; j++) _dict.refSchemaComponents(tables[j]); } group.removeUnusedComponents(); }
@Override protected void serializeClass(ClassMetaData meta) { if (_sync && isMappingMode() && meta instanceof ClassMapping) { // sync if resolved and mapped ClassMapping cls = (ClassMapping) meta; if ((cls.getResolve() & MetaDataModes.MODE_MAPPING) != 0 && cls.isMapped()) { cls.syncMappingInfo(); cls.getDiscriminator().syncMappingInfo(); cls.getVersion().syncMappingInfo(); FieldMapping[] fields; if (cls.getEmbeddingMetaData() == null) fields = cls.getDefinedFieldMappings(); else fields = cls.getFieldMappings(); for (FieldMapping f : fields) f.syncMappingInfo(); } } super.serializeClass(meta); }
/** * Drops schema components that appear to be unused from the local * copy of the schema group. */ private void dropUnusedSchemaComponents(ClassMapping[] mappings) { FieldMapping[] fields; for (int i = 0; i < mappings.length; i++) { mappings[i].refSchemaComponents(); mappings[i].getDiscriminator().refSchemaComponents(); mappings[i].getVersion().refSchemaComponents(); fields = mappings[i].getDefinedFieldMappings(); for (int j = 0; j < fields.length; j++) fields[j].refSchemaComponents(); } // also allow the dbdictionary to ref any schema components that // it adds apart from mappings SchemaGroup group = getSchemaGroup(); Schema[] schemas = group.getSchemas(); Table[] tables; for (int i = 0; i < schemas.length; i++) { tables = schemas[i].getTables(); for (int j = 0; j < tables.length; j++) _dict.refSchemaComponents(tables[j]); } group.removeUnusedComponents(); }
@Override protected void serializeClass(ClassMetaData meta) { if (_sync && isMappingMode() && meta instanceof ClassMapping) { // sync if resolved and mapped ClassMapping cls = (ClassMapping) meta; if ((cls.getResolve() & MetaDataModes.MODE_MAPPING) != 0 && cls.isMapped()) { cls.syncMappingInfo(); cls.getDiscriminator().syncMappingInfo(); cls.getVersion().syncMappingInfo(); FieldMapping[] fields; if (cls.getEmbeddingMetaData() == null) fields = cls.getDefinedFieldMappings(); else fields = cls.getFieldMappings(); for (FieldMapping f : fields) f.syncMappingInfo(); } } super.serializeClass(meta); }
@Override protected void serializeClass(ClassMetaData meta, boolean access) throws SAXException { if (_sync && isMappingMode() && meta instanceof ClassMapping) { // sync if resolved and mapped ClassMapping cls = (ClassMapping) meta; if ((cls.getResolve() & MODE_MAPPING) != 0 && cls.isMapped()) { cls.syncMappingInfo(); cls.getDiscriminator().syncMappingInfo(); cls.getVersion().syncMappingInfo(); FieldMapping[] fields; if (cls.getEmbeddingMetaData() == null) fields = cls.getDefinedFieldMappings(); else fields = cls.getFieldMappings(); for (FieldMapping f : fields) f.syncMappingInfo(); } } super.serializeClass(meta, access); }
@Override protected void serializeClass(ClassMetaData meta, boolean access) throws SAXException { if (_sync && isMappingMode() && meta instanceof ClassMapping) { // sync if resolved and mapped ClassMapping cls = (ClassMapping) meta; if ((cls.getResolve() & MODE_MAPPING) != 0 && cls.isMapped()) { cls.syncMappingInfo(); cls.getDiscriminator().syncMappingInfo(); cls.getVersion().syncMappingInfo(); FieldMapping[] fields; if (cls.getEmbeddingMetaData() == null) fields = cls.getDefinedFieldMappings(); else fields = cls.getFieldMappings(); for (FieldMapping f : fields) f.syncMappingInfo(); } } super.serializeClass(meta, access); }
@Override protected void serializeClass(ClassMetaData meta) { if (_sync && isMappingMode() && meta instanceof ClassMapping) { // sync if resolved and mapped ClassMapping cls = (ClassMapping) meta; if ((cls.getResolve() & MetaDataModes.MODE_MAPPING) != 0 && cls.isMapped()) { cls.syncMappingInfo(); cls.getDiscriminator().syncMappingInfo(); cls.getVersion().syncMappingInfo(); FieldMapping[] fields; if (cls.getEmbeddingMetaData() == null) fields = cls.getDefinedFieldMappings(); else fields = cls.getFieldMappings(); for (FieldMapping f : fields) f.syncMappingInfo(); } } super.serializeClass(meta); }
@Override protected void serializeClass(ClassMetaData meta) { if (_sync && isMappingMode() && meta instanceof ClassMapping) { // sync if resolved and mapped ClassMapping cls = (ClassMapping) meta; if ((cls.getResolve() & MetaDataModes.MODE_MAPPING) != 0 && cls.isMapped()) { cls.syncMappingInfo(); cls.getDiscriminator().syncMappingInfo(); cls.getVersion().syncMappingInfo(); FieldMapping[] fields; if (cls.getEmbeddingMetaData() == null) fields = cls.getDefinedFieldMappings(); else fields = cls.getFieldMappings(); for (FieldMapping f : fields) f.syncMappingInfo(); } } super.serializeClass(meta); }
@Override protected void serializeClass(ClassMetaData meta, boolean access) throws SAXException { if (_sync && isMappingMode() && meta instanceof ClassMapping) { // sync if resolved and mapped ClassMapping cls = (ClassMapping) meta; if ((cls.getResolve() & MODE_MAPPING) != 0 && cls.isMapped()) { cls.syncMappingInfo(); cls.getDiscriminator().syncMappingInfo(); cls.getVersion().syncMappingInfo(); FieldMapping[] fields; if (cls.getEmbeddingMetaData() == null) fields = cls.getDefinedFieldMappings(); else fields = cls.getFieldMappings(); for (FieldMapping f : fields) f.syncMappingInfo(); } } super.serializeClass(meta, access); }
@Override protected void serializeClass(ClassMetaData meta, boolean access) throws SAXException { if (_sync && isMappingMode() && meta instanceof ClassMapping) { // sync if resolved and mapped ClassMapping cls = (ClassMapping) meta; if ((cls.getResolve() & MODE_MAPPING) != 0 && cls.isMapped()) { cls.syncMappingInfo(); cls.getDiscriminator().syncMappingInfo(); cls.getVersion().syncMappingInfo(); FieldMapping[] fields; if (cls.getEmbeddingMetaData() == null) fields = cls.getDefinedFieldMappings(); else fields = cls.getFieldMappings(); for (FieldMapping f : fields) f.syncMappingInfo(); } } super.serializeClass(meta, access); }