/** * Parse class-level @XMappingOverride(s). */ private void parseMappingOverrides(ClassMapping cm, XMappingOverride... overs) { FieldMapping sup; for (XMappingOverride over : overs) { if (StringUtils.isEmpty(over.name())) throw new MetaDataException(_loc.get("no-override-name", cm)); sup = (FieldMapping) cm.getDefinedSuperclassField(over.name()); if (sup == null) sup = (FieldMapping) cm.addDefinedSuperclassField(over.name(), Object.class, Object.class); populate(sup, over); } }
/** * Parse class-level @XMappingOverride(s). */ private void parseMappingOverrides(ClassMapping cm, XMappingOverride... overs) { FieldMapping sup; for (XMappingOverride over : overs) { if (StringUtils.isEmpty(over.name())) throw new MetaDataException(_loc.get("no-override-name", cm)); sup = (FieldMapping) cm.getDefinedSuperclassField(over.name()); if (sup == null) sup = (FieldMapping) cm.addDefinedSuperclassField(over.name(), Object.class, Object.class); populate(sup, over); } }
/** * Parse class-level @XMappingOverride(s). */ private void parseMappingOverrides(ClassMapping cm, XMappingOverride... overs) { FieldMapping sup; for (XMappingOverride over : overs) { if (StringUtil.isEmpty(over.name())) throw new MetaDataException(_loc.get("no-override-name", cm)); sup = (FieldMapping) cm.getDefinedSuperclassField(over.name()); if (sup == null) sup = (FieldMapping) cm.addDefinedSuperclassField(over.name(), Object.class, Object.class); populate(sup, over); } }
/** * Parse class-level @XMappingOverride(s). */ private void parseMappingOverrides(ClassMapping cm, XMappingOverride... overs) { FieldMapping sup; for (XMappingOverride over : overs) { if (StringUtil.isEmpty(over.name())) throw new MetaDataException(_loc.get("no-override-name", cm)); sup = (FieldMapping) cm.getDefinedSuperclassField(over.name()); if (sup == null) sup = (FieldMapping) cm.addDefinedSuperclassField(over.name(), Object.class, Object.class); populate(sup, over); } }
/** * Parse embedded info for the given mapping. */ private void parseEmbeddedMapping(ValueMapping vm, String nullIndicatorAttribute, String nullIndicatorColumn, XMappingOverride[] overrides) { ClassMapping embed = vm.getEmbeddedMapping(); if (embed == null) throw new MetaDataException(_loc.get("not-embedded", vm)); FieldMapping efm; for (XMappingOverride over : overrides) { efm = embed.getFieldMapping(over.name()); if (efm == null) throw new MetaDataException(_loc.get("embed-override-name", vm, over.name())); populate(efm, over); } String nullInd = null; if (!StringUtils.isEmpty(nullIndicatorAttribute)) nullInd = nullIndicatorAttribute; else if (!StringUtils.isEmpty(nullIndicatorColumn)) nullInd = nullIndicatorColumn; if (nullInd == null) return; ValueMappingInfo info = vm.getValueInfo(); populateNullIndicator(nullInd, info); }
/** * Parse embedded info for the given mapping. */ private void parseEmbeddedMapping(ValueMapping vm, DBIdentifier nullIndicatorAttribute, DBIdentifier nullIndicatorColumn, XMappingOverride[] overrides) { ClassMapping embed = vm.getEmbeddedMapping(); if (embed == null) throw new MetaDataException(_loc.get("not-embedded", vm)); FieldMapping efm; for (XMappingOverride over : overrides) { efm = embed.getFieldMapping(over.name()); if (efm == null) throw new MetaDataException(_loc.get("embed-override-name", vm, over.name())); populate(efm, over); } DBIdentifier nullInd = DBIdentifier.NULL; if (!DBIdentifier.isEmpty(nullIndicatorAttribute)) nullInd = nullIndicatorAttribute; else if (!DBIdentifier.isEmpty(nullIndicatorColumn)) nullInd = nullIndicatorColumn; if (DBIdentifier.isNull(nullInd)) return; ValueMappingInfo info = vm.getValueInfo(); populateNullIndicator(nullInd, info); }
/** * Parse embedded info for the given mapping. */ private void parseEmbeddedMapping(ValueMapping vm, DBIdentifier nullIndicatorAttribute, DBIdentifier nullIndicatorColumn, XMappingOverride[] overrides) { ClassMapping embed = vm.getEmbeddedMapping(); if (embed == null) throw new MetaDataException(_loc.get("not-embedded", vm)); FieldMapping efm; for (XMappingOverride over : overrides) { efm = embed.getFieldMapping(over.name()); if (efm == null) throw new MetaDataException(_loc.get("embed-override-name", vm, over.name())); populate(efm, over); } DBIdentifier nullInd = DBIdentifier.NULL; if (!DBIdentifier.isEmpty(nullIndicatorAttribute)) nullInd = nullIndicatorAttribute; else if (!DBIdentifier.isEmpty(nullIndicatorColumn)) nullInd = nullIndicatorColumn; if (DBIdentifier.isNull(nullInd)) return; ValueMappingInfo info = vm.getValueInfo(); populateNullIndicator(nullInd, info); }
/** * Parse embedded info for the given mapping. */ private void parseEmbeddedMapping(ValueMapping vm, DBIdentifier nullIndicatorAttribute, DBIdentifier nullIndicatorColumn, XMappingOverride[] overrides) { ClassMapping embed = vm.getEmbeddedMapping(); if (embed == null) throw new MetaDataException(_loc.get("not-embedded", vm)); FieldMapping efm; for (XMappingOverride over : overrides) { efm = embed.getFieldMapping(over.name()); if (efm == null) throw new MetaDataException(_loc.get("embed-override-name", vm, over.name())); populate(efm, over); } DBIdentifier nullInd = DBIdentifier.NULL; if (!DBIdentifier.isEmpty(nullIndicatorAttribute)) nullInd = nullIndicatorAttribute; else if (!DBIdentifier.isEmpty(nullIndicatorColumn)) nullInd = nullIndicatorColumn; if (DBIdentifier.isNull(nullInd)) return; ValueMappingInfo info = vm.getValueInfo(); populateNullIndicator(nullInd, info); }