/** * Parse table. */ private boolean startTable(Attributes attrs) throws SAXException { ClassMapping mapping = (ClassMapping) currentElement(); if (mapping.isAbstract()) throw new UserException(_loc.get("table-not-allowed", mapping)); DBIdentifier table = toTableIdentifier(attrs.getValue("schema"), attrs.getValue("name")); if (!DBIdentifier.isNull(table)) mapping.getMappingInfo().setTableIdentifier(table); return true; }
/** * Parse table. */ private boolean startTable(Attributes attrs) throws SAXException { ClassMapping mapping = (ClassMapping) currentElement(); if (mapping.isAbstract()) throw new UserException(_loc.get("table-not-allowed", mapping)); DBIdentifier table = toTableIdentifier(attrs.getValue("schema"), attrs.getValue("name")); if (!DBIdentifier.isNull(table)) mapping.getMappingInfo().setTableIdentifier(table); return true; }
/** * Parse table. */ private boolean startTable(Attributes attrs) throws SAXException { ClassMapping mapping = (ClassMapping) currentElement(); if (mapping.isAbstract()) throw new UserException(_loc.get("table-not-allowed", mapping)); DBIdentifier table = toTableIdentifier(attrs.getValue("schema"), attrs.getValue("name")); if (!DBIdentifier.isNull(table)) mapping.getMappingInfo().setTableIdentifier(table); return true; }
/** * Set class table. */ private void parseTable(ClassMapping cm, Table table) { if (cm.isAbstract()) throw new UserException(_loc.get("table-not-allowed", cm)); DBIdentifier tName = toTableIdentifier(table.schema(), table.name()); if (!DBIdentifier.isNull(tName)) { cm.getMappingInfo().setTableIdentifier(tName); } addUniqueConstraints(tName.getName(), cm, cm.getMappingInfo(), table.uniqueConstraints()); }
/** * Set class table. */ private void parseTable(ClassMapping cm, Table table) { if (cm.isAbstract()) throw new UserException(_loc.get("table-not-allowed", cm)); DBIdentifier tName = toTableIdentifier(table.schema(), table.name()); if (!DBIdentifier.isNull(tName)) { cm.getMappingInfo().setTableIdentifier(tName); } addUniqueConstraints(tName.getName(), cm, cm.getMappingInfo(), table.uniqueConstraints()); }
/** * Set class table. */ private void parseTable(ClassMapping cm, Table table) { if (cm.isAbstract()) throw new UserException(_loc.get("table-not-allowed", cm)); DBIdentifier tName = toTableIdentifier(table.schema(), table.name()); if (!DBIdentifier.isNull(tName)) { cm.getMappingInfo().setTableIdentifier(tName); } addUniqueConstraints(tName.getName(), cm, cm.getMappingInfo(), table.uniqueConstraints()); }
public void installStrategy(FieldMapping field) { FieldStrategy strategy = null; ClassMapping owner = getOutermostDefiningMapping(field); if (owner != null && !owner.isEmbeddable() && !owner.isAbstract()) strategy = repos.namedStrategy(field, true); if (strategy == null) { try { strategy = repos.defaultStrategy(field, true, false); } catch (MetaDataException mde) { // if the parent class is abstract and field is unmapped, // allow it to pass (assume subclasses map the field) Class cls = field.getDefiningMetaData().getDescribedType(); if (!Modifier.isAbstract(cls.getModifiers()) || field.getMappedBy() != null || field.getMappingInfo().hasSchemaComponents() || field.getValueInfo().hasSchemaComponents() || field.getElementMapping().getValueInfo().hasSchemaComponents() || field.getKeyMapping().getValueInfo().hasSchemaComponents()) throw mde; strategy = NoneFieldStrategy.getInstance(); } } field.setStrategy(strategy, Boolean.FALSE); }
public void installStrategy(FieldMapping field) { FieldStrategy strategy = null; ClassMapping owner = getOutermostDefiningMapping(field); if (owner != null && !owner.isEmbeddable() && !owner.isAbstract()) strategy = repos.namedStrategy(field, true); if (strategy == null) { try { strategy = repos.defaultStrategy(field, true, false); } catch (MetaDataException mde) { // if the parent class is abstract and field is unmapped, // allow it to pass (assume subclasses map the field) Class cls = field.getDefiningMetaData().getDescribedType(); if (!Modifier.isAbstract(cls.getModifiers()) || field.getMappedBy() != null || field.getMappingInfo().hasSchemaComponents() || field.getValueInfo().hasSchemaComponents() || field.getElementMapping().getValueInfo().hasSchemaComponents() || field.getKeyMapping().getValueInfo().hasSchemaComponents()) throw mde; strategy = NoneFieldStrategy.getInstance(); } } field.setStrategy(strategy, Boolean.FALSE); }
public void installStrategy(FieldMapping field) { FieldStrategy strategy = null; ClassMapping owner = getOutermostDefiningMapping(field); if (owner != null && !owner.isEmbeddable() && !owner.isAbstract()) strategy = repos.namedStrategy(field, true); if (strategy == null) { try { strategy = repos.defaultStrategy(field, true, false); } catch (MetaDataException mde) { // if the parent class is abstract and field is unmapped, // allow it to pass (assume subclasses map the field) Class cls = field.getDefiningMetaData().getDescribedType(); if (!Modifier.isAbstract(cls.getModifiers()) || field.getMappedBy() != null || field.getMappingInfo().hasSchemaComponents() || field.getValueInfo().hasSchemaComponents() || field.getElementMapping().getValueInfo().hasSchemaComponents() || field.getKeyMapping().getValueInfo().hasSchemaComponents()) throw mde; strategy = NoneFieldStrategy.getInstance(); } } field.setStrategy(strategy, Boolean.FALSE); }
public void installStrategy(FieldMapping field) { FieldStrategy strategy = null; ClassMapping owner = getOutermostDefiningMapping(field); if (owner != null && !owner.isEmbeddable() && !owner.isAbstract()) strategy = repos.namedStrategy(field, true); if (strategy == null) { try { strategy = repos.defaultStrategy(field, true, false); } catch (MetaDataException mde) { // if the parent class is abstract and field is unmapped, // allow it to pass (assume subclasses map the field) Class cls = field.getDefiningMetaData().getDescribedType(); if (!Modifier.isAbstract(cls.getModifiers()) || field.getMappedBy() != null || field.getMappingInfo().hasSchemaComponents() || field.getValueInfo().hasSchemaComponents() || field.getElementMapping().getValueInfo().hasSchemaComponents() || field.getKeyMapping().getValueInfo().hasSchemaComponents()) throw mde; strategy = NoneFieldStrategy.getInstance(); } } field.setStrategy(strategy, Boolean.FALSE); }