HHH-6080: Created XSDs from existing mapping and configuration DTDs
This commit is contained in:
parent
20064fa743
commit
60d2c5a7bb
|
@ -36,7 +36,7 @@ import org.hibernate.metamodel.domain.MetaAttribute;
|
|||
import org.hibernate.metamodel.relational.Column;
|
||||
import org.hibernate.metamodel.relational.TableSpecification;
|
||||
import org.hibernate.metamodel.source.hbm.HbmHelper;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLClass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLSqlDelete;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLSqlInsert;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLSqlUpdate;
|
||||
|
|
|
@ -47,11 +47,36 @@ import org.hibernate.metamodel.relational.Schema;
|
|||
import org.hibernate.metamodel.relational.Table;
|
||||
import org.hibernate.metamodel.relational.TableSpecification;
|
||||
import org.hibernate.metamodel.relational.UniqueKey;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.*;
|
||||
import org.hibernate.metamodel.source.internal.MetadataImpl;
|
||||
import org.hibernate.metamodel.source.hbm.state.domain.HbmPluralAttributeDomainState;
|
||||
import org.hibernate.metamodel.source.hbm.state.domain.HbmSimpleAttributeDomainState;
|
||||
import org.hibernate.metamodel.source.hbm.state.relational.HbmSimpleValueRelationalStateContainer;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLAny;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLBag;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLComponent;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLDynamicComponent;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLFilter;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLDiscriminator;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLTimestamp;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLVersion;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLIdbag;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLJoin;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLJoinedSubclass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLList;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLManyToOne;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLMap;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLOneToOne;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLProperties;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLProperty;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLQuery;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLResultset;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLSet;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLSqlQuery;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLSubclass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLTuplizer;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLUnionSubclass;
|
||||
|
||||
/**
|
||||
* TODO : javadoc
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.hibernate.MappingException;
|
|||
import org.hibernate.engine.ExecuteUpdateResultCheckStyle;
|
||||
import org.hibernate.metamodel.binding.CustomSQL;
|
||||
import org.hibernate.metamodel.domain.MetaAttribute;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLClass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLMeta;
|
||||
import org.hibernate.metamodel.source.util.DomHelper;
|
||||
import org.hibernate.metamodel.source.util.MappingHelper;
|
||||
|
|
|
@ -36,11 +36,11 @@ import org.hibernate.metamodel.binding.MappingDefaults;
|
|||
import org.hibernate.metamodel.domain.MetaAttribute;
|
||||
import org.hibernate.metamodel.source.Origin;
|
||||
import org.hibernate.metamodel.source.internal.JaxbRoot;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLClass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLFetch;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLFetchProfile;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLFetchProfile.XMLFetch;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLImport;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLImport;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLJoinedSubclass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLQuery;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLSqlQuery;
|
||||
|
|
|
@ -34,9 +34,9 @@ import org.hibernate.metamodel.relational.Identifier;
|
|||
import org.hibernate.metamodel.relational.InLineView;
|
||||
import org.hibernate.metamodel.relational.Schema;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLCache;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLClass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLCompositeId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLCompositeId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLId;
|
||||
import org.hibernate.metamodel.source.util.MappingHelper;
|
||||
|
||||
/**
|
||||
|
@ -92,7 +92,7 @@ class RootEntityBinder extends AbstractEntityBinder {
|
|||
final Schema schema = getHibernateXmlBinder().getMetadata().getDatabase().getSchema( getSchemaName() );
|
||||
|
||||
final String subSelect =
|
||||
xmlClazz.getSubselect() == null ? xmlClazz.getSubselectElement() : xmlClazz.getSubselect();
|
||||
xmlClazz.getSubselectAttribute() == null ? xmlClazz.getSubselect() : xmlClazz.getSubselectAttribute();
|
||||
if ( subSelect != null ) {
|
||||
final String logicalName = entityBinding.getEntity().getName();
|
||||
InLineView inLineView = schema.getInLineView( logicalName );
|
||||
|
|
|
@ -33,11 +33,11 @@ import org.hibernate.metamodel.domain.Attribute;
|
|||
import org.hibernate.metamodel.domain.MetaAttribute;
|
||||
import org.hibernate.metamodel.source.hbm.HbmHelper;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLBag;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLDiscriminator;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLDiscriminator;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLTimestamp;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLVersion;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLProperty;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLTimestamp;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLVersion;
|
||||
import org.hibernate.metamodel.source.util.MappingHelper;
|
||||
|
||||
/**
|
||||
|
@ -60,7 +60,7 @@ public abstract class AbstractHbmAttributeDomainState implements AbstractAttribu
|
|||
this.defaults = defaults;
|
||||
this.attribute = attribute;
|
||||
this.hibernateTypeDescriptor = new HibernateTypeDescriptor();
|
||||
this.hibernateTypeDescriptor.setTypeName( id.getType() );
|
||||
this.hibernateTypeDescriptor.setTypeName( id.getTypeAttribute() );
|
||||
this.accessorName = HbmHelper.getPropertyAccessorName(
|
||||
id.getAccess(), isEmbedded(), defaults.getDefaultAccess()
|
||||
);
|
||||
|
@ -77,7 +77,7 @@ public abstract class AbstractHbmAttributeDomainState implements AbstractAttribu
|
|||
this.defaults = defaults;
|
||||
this.attribute = attribute;
|
||||
this.hibernateTypeDescriptor = new HibernateTypeDescriptor();
|
||||
this.hibernateTypeDescriptor.setTypeName( discriminator.getType() == null ? "string" : discriminator.getType() );
|
||||
this.hibernateTypeDescriptor.setTypeName( discriminator.getTypeAttribute() == null ? "string" : discriminator.getTypeAttribute() );
|
||||
// the following does not apply to discriminators
|
||||
this.accessorName = null;
|
||||
this.nodeName = null;
|
||||
|
@ -93,7 +93,7 @@ public abstract class AbstractHbmAttributeDomainState implements AbstractAttribu
|
|||
this.defaults = defaults;
|
||||
this.attribute = attribute;
|
||||
this.hibernateTypeDescriptor = new HibernateTypeDescriptor();
|
||||
this.hibernateTypeDescriptor.setTypeName( version.getType() == null ? "integer" : version.getType() );
|
||||
this.hibernateTypeDescriptor.setTypeName( version.getTypeAttribute() == null ? "integer" : version.getTypeAttribute() );
|
||||
|
||||
// the following does not apply to discriminators
|
||||
this.accessorName = HbmHelper.getPropertyAccessorName(
|
||||
|
@ -134,7 +134,7 @@ public abstract class AbstractHbmAttributeDomainState implements AbstractAttribu
|
|||
this.defaults = defaults;
|
||||
this.attribute = attribute;
|
||||
this.hibernateTypeDescriptor = new HibernateTypeDescriptor();
|
||||
this.hibernateTypeDescriptor.setTypeName( property.getType() );
|
||||
this.hibernateTypeDescriptor.setTypeName( property.getTypeAttribute() );
|
||||
this.accessorName = HbmHelper.getPropertyAccessorName(
|
||||
property.getAccess(), isEmbedded(), defaults.getDefaultAccess()
|
||||
);
|
||||
|
|
|
@ -39,7 +39,7 @@ public class HbmCollectionElementDomainState implements CollectionElement.Domain
|
|||
|
||||
public final HibernateTypeDescriptor getHibernateTypeDescriptor() {
|
||||
HibernateTypeDescriptor hibernateTypeDescriptor = new HibernateTypeDescriptor();
|
||||
hibernateTypeDescriptor.setTypeName( element.getType() );
|
||||
hibernateTypeDescriptor.setTypeName( element.getTypeAttribute() );
|
||||
return hibernateTypeDescriptor;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,11 +30,11 @@ import org.hibernate.mapping.PropertyGeneration;
|
|||
import org.hibernate.metamodel.binding.MappingDefaults;
|
||||
import org.hibernate.metamodel.binding.SimpleAttributeBinding;
|
||||
import org.hibernate.metamodel.domain.MetaAttribute;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLDiscriminator;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLDiscriminator;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLTimestamp;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLVersion;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLProperty;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLTimestamp;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLVersion;
|
||||
import org.hibernate.metamodel.source.util.MappingHelper;
|
||||
|
||||
/**
|
||||
|
@ -151,6 +151,7 @@ public class HbmSimpleAttributeDomainState extends AbstractHbmAttributeDomainSta
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEmbedded() {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -29,12 +29,12 @@ import org.hibernate.MappingException;
|
|||
import org.hibernate.cfg.NamingStrategy;
|
||||
import org.hibernate.metamodel.binding.SimpleAttributeBinding;
|
||||
import org.hibernate.metamodel.relational.Size;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLColumnElement;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLDiscriminator;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLColumn;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLDiscriminator;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLTimestamp;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLVersion;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLProperty;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLTimestamp;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLVersion;
|
||||
import org.hibernate.metamodel.source.util.MappingHelper;
|
||||
|
||||
// TODO: remove duplication after Id, Discriminator, Version, Timestamp, and Property extend a common interface.
|
||||
|
@ -58,7 +58,7 @@ public class HbmColumnRelationalState implements SimpleAttributeBinding.ColumnRe
|
|||
private final Set<String> indexes;
|
||||
|
||||
/* package-protected */
|
||||
HbmColumnRelationalState(XMLColumnElement columnElement,
|
||||
HbmColumnRelationalState(XMLColumn columnElement,
|
||||
HbmSimpleValueRelationalStateContainer container) {
|
||||
this.container = container;
|
||||
this.explicitColumnName = columnElement.getName();
|
||||
|
@ -101,7 +101,7 @@ public class HbmColumnRelationalState implements SimpleAttributeBinding.ColumnRe
|
|||
|
||||
HbmColumnRelationalState(XMLId id,
|
||||
HbmSimpleValueRelationalStateContainer container) {
|
||||
if ( id.getColumnElement() != null && ! id.getColumnElement().isEmpty() ) {
|
||||
if ( id.getColumn() != null && ! id.getColumn().isEmpty() ) {
|
||||
throw new IllegalArgumentException( "This method should not be called with non-empty id.getColumnElement()" );
|
||||
}
|
||||
this.container = container;
|
||||
|
@ -121,7 +121,7 @@ public class HbmColumnRelationalState implements SimpleAttributeBinding.ColumnRe
|
|||
|
||||
HbmColumnRelationalState(XMLDiscriminator discriminator,
|
||||
HbmSimpleValueRelationalStateContainer container) {
|
||||
if ( discriminator.getColumnElement() != null ) {
|
||||
if ( discriminator.getColumn() != null ) {
|
||||
throw new IllegalArgumentException( "This method should not be called with null discriminator.getColumnElement()" );
|
||||
}
|
||||
this.container = container;
|
||||
|
@ -142,8 +142,8 @@ public class HbmColumnRelationalState implements SimpleAttributeBinding.ColumnRe
|
|||
HbmColumnRelationalState(XMLVersion version,
|
||||
HbmSimpleValueRelationalStateContainer container) {
|
||||
this.container = container;
|
||||
this.explicitColumnName = version.getColumn();
|
||||
if ( version.getColumnElement() != null && ! version.getColumnElement().isEmpty() ) {
|
||||
this.explicitColumnName = version.getColumnAttribute();
|
||||
if ( version.getColumn() != null && ! version.getColumn().isEmpty() ) {
|
||||
throw new IllegalArgumentException( "This method should not be called with non-empty version.getColumnElement()" );
|
||||
}
|
||||
// TODO: should set default
|
||||
|
@ -163,7 +163,7 @@ public class HbmColumnRelationalState implements SimpleAttributeBinding.ColumnRe
|
|||
HbmColumnRelationalState(XMLTimestamp timestamp,
|
||||
HbmSimpleValueRelationalStateContainer container) {
|
||||
this.container = container;
|
||||
this.explicitColumnName = timestamp.getColumn();
|
||||
this.explicitColumnName = timestamp.getColumnAttribute();
|
||||
// TODO: should set default
|
||||
this.size = new Size();
|
||||
this.isNullable = false;
|
||||
|
|
|
@ -32,12 +32,12 @@ import org.hibernate.MappingException;
|
|||
import org.hibernate.cfg.NamingStrategy;
|
||||
import org.hibernate.metamodel.binding.MappingDefaults;
|
||||
import org.hibernate.metamodel.binding.SimpleAttributeBinding;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLColumnElement;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLDiscriminator;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLColumn;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLDiscriminator;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLId;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLTimestamp;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLHibernateMapping.XMLClass.XMLVersion;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLProperty;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLTimestamp;
|
||||
import org.hibernate.metamodel.source.hbm.xml.mapping.XMLVersion;
|
||||
|
||||
/**
|
||||
* @author Gail Badner
|
||||
|
@ -57,7 +57,7 @@ public class HbmSimpleValueRelationalStateContainer implements SimpleAttributeBi
|
|||
public HbmSimpleValueRelationalStateContainer(MappingDefaults defaults,
|
||||
boolean autoColumnCreation,
|
||||
XMLId id) {
|
||||
this( defaults, id.getColumnElement() );
|
||||
this( defaults, id.getColumn() );
|
||||
if ( singleValueStates.isEmpty() ) {
|
||||
if ( id.getColumn() == null && ! autoColumnCreation ) {
|
||||
throw new MappingException( "No columns to map and auto column creation is disabled." );
|
||||
|
@ -72,7 +72,7 @@ public class HbmSimpleValueRelationalStateContainer implements SimpleAttributeBi
|
|||
public HbmSimpleValueRelationalStateContainer(MappingDefaults defaults,
|
||||
boolean autoColumnCreation,
|
||||
XMLDiscriminator discriminator) {
|
||||
this( defaults, discriminator.getFormulaElement(), discriminator.getColumnElement() );
|
||||
this( defaults, discriminator.getFormulaAttribute(), discriminator.getColumn() );
|
||||
if ( singleValueStates.isEmpty() ) {
|
||||
if ( discriminator.getColumn() == null && discriminator.getFormula() == null && ! autoColumnCreation ) {
|
||||
throw new MappingException( "No column or formula to map and auto column creation is disabled." );
|
||||
|
@ -87,7 +87,7 @@ public class HbmSimpleValueRelationalStateContainer implements SimpleAttributeBi
|
|||
public HbmSimpleValueRelationalStateContainer(MappingDefaults defaults,
|
||||
boolean autoColumnCreation,
|
||||
XMLVersion version) {
|
||||
this( defaults, version.getColumnElement() );
|
||||
this( defaults, version.getColumn() );
|
||||
if ( singleValueStates.isEmpty() ) {
|
||||
if ( version.getColumn() == null && ! autoColumnCreation ) {
|
||||
throw new MappingException( "No column or formula to map and auto column creation is disabled." );
|
||||
|
@ -104,12 +104,12 @@ public class HbmSimpleValueRelationalStateContainer implements SimpleAttributeBi
|
|||
XMLTimestamp timestamp) {
|
||||
this( defaults, null );
|
||||
if ( singleValueStates.isEmpty() ) {
|
||||
if ( timestamp.getColumn() == null && ! autoColumnCreation ) {
|
||||
if ( timestamp.getColumnAttribute() == null && ! autoColumnCreation ) {
|
||||
throw new MappingException( "No columns to map and auto column creation is disabled." );
|
||||
}
|
||||
singleValueStates.add( new HbmColumnRelationalState( timestamp, this ) );
|
||||
}
|
||||
else if ( timestamp.getColumn() != null ) {
|
||||
else if ( timestamp.getColumnAttribute() != null ) {
|
||||
throw new MappingException( "column attribute may not be used together with <column> subelement" );
|
||||
}
|
||||
}
|
||||
|
@ -117,21 +117,21 @@ public class HbmSimpleValueRelationalStateContainer implements SimpleAttributeBi
|
|||
public HbmSimpleValueRelationalStateContainer(MappingDefaults defaults,
|
||||
boolean autoColumnCreation,
|
||||
XMLProperty property) {
|
||||
this( defaults, property.getColumnElementOrFormulaElement() );
|
||||
this( defaults, property.getColumnOrFormula() );
|
||||
if ( singleValueStates.isEmpty() ) {
|
||||
if ( property.getColumn() == null && property.getFormula() == null && ! autoColumnCreation ) {
|
||||
if ( property.getColumnAttribute() == null && property.getFormulaAttribute() == null && ! autoColumnCreation ) {
|
||||
throw new MappingException( "No column or formula to map and auto column creation is disabled." );
|
||||
}
|
||||
singleValueStates.add( new HbmColumnRelationalState( property, this ) );
|
||||
}
|
||||
else if ( property.getColumn() != null || property.getFormula() != null) {
|
||||
else if ( property.getColumnAttribute() != null || property.getFormulaAttribute() != null) {
|
||||
throw new MappingException( "column/formula attribute may not be used together with <column>/<formula> subelement" );
|
||||
}
|
||||
}
|
||||
|
||||
private HbmSimpleValueRelationalStateContainer(MappingDefaults defaults,
|
||||
String formulaElement,
|
||||
XMLColumnElement columnElement
|
||||
XMLColumn columnElement
|
||||
) {
|
||||
this( defaults,
|
||||
formulaElement != null ?
|
||||
|
@ -160,9 +160,9 @@ public class HbmSimpleValueRelationalStateContainer implements SimpleAttributeBi
|
|||
private static SimpleAttributeBinding.SingleValueRelationalState createColumnOrFormulaRelationalState(
|
||||
HbmSimpleValueRelationalStateContainer container,
|
||||
Object columnOrFormula) {
|
||||
if ( XMLColumnElement.class.isInstance( columnOrFormula ) ) {
|
||||
if ( XMLColumn.class.isInstance( columnOrFormula ) ) {
|
||||
return new HbmColumnRelationalState(
|
||||
XMLColumnElement.class.cast( columnOrFormula ),
|
||||
XMLColumn.class.cast( columnOrFormula ),
|
||||
container
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,255 +1,101 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Hibernate, Relational Persistence for Idiomatic Java
|
||||
~
|
||||
~ Copyright (c) 2011, Red Hat Inc. or third-party contributors as
|
||||
~ indicated by the @author tags or express copyright attribution
|
||||
~ statements applied by the authors. All third-party contributions are
|
||||
~ distributed under license by Red Hat Inc.
|
||||
~
|
||||
~ This copyrighted material is made available to anyone wishing to use, modify,
|
||||
~ copy, or redistribute it subject to the terms and conditions of the GNU
|
||||
~ Lesser General Public License, as published by the Free Software Foundation.
|
||||
~
|
||||
~ This program is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||
~ for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Lesser General Public License
|
||||
~ along with this distribution; if not, write to:
|
||||
~ Free Software Foundation, Inc.
|
||||
~ 51 Franklin Street, Fifth Floor
|
||||
~ Boston, MA 02110-1301 USA
|
||||
-->
|
||||
|
||||
<!--
|
||||
Hibernate file-based configuration document.
|
||||
|
||||
<!DOCTYPE hibernate-configuration PUBLIC
|
||||
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
|
||||
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
|
||||
|
||||
An instance of this document contains property settings and references
|
||||
to mapping files for a number of SessionFactory instances to be listed
|
||||
in JNDI.
|
||||
|
||||
<!-- Hibernate file-based configuration document.
|
||||
|
||||
|
||||
|
||||
An instance of this document contains property settings and references
|
||||
to mapping files for a number of SessionFactory instances to be listed
|
||||
in JNDI.
|
||||
|
||||
-->
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://www.hibernate.org/xsd/hibernate-configuration"
|
||||
xmlns:config="http://www.hibernate.org/xsd/hibernate-configuration" version="4.0">
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns="http://www.hibernate.org/xsd/hibernate-configuration"
|
||||
targetNamespace="http://www.hibernate.org/xsd/hibernate-configuration"
|
||||
version="4.0">
|
||||
|
||||
<xs:element name="hibernate-configuration">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="config:session-factory"/>
|
||||
<xs:element minOccurs="0" ref="config:security"/>
|
||||
<xs:element name="session-factory">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType mixed="true">
|
||||
<xs:attribute name="name" use="required"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="mapping" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="resource"/>
|
||||
<xs:attribute name="file"/>
|
||||
<xs:attribute name="jar"/>
|
||||
<xs:attribute name="package"/>
|
||||
<xs:attribute ref="class"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="class-cache">
|
||||
<xs:complexType>
|
||||
<xs:attribute ref="class" use="required"/>
|
||||
<xs:attribute ref="region"/>
|
||||
<xs:attribute ref="usage" use="required"/>
|
||||
<xs:attribute name="include" default="all">
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="collection-cache">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="collection" use="required"/>
|
||||
<xs:attribute ref="region"/>
|
||||
<xs:attribute ref="usage" use="required"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
<xs:element name="event" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="listener" type="listenerType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute ref="type" use="required"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="listener" type="listenerType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name"/> <!-- the JNDI name -->
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="security" minOccurs="0">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="grant" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="role" use="required"/>
|
||||
<xs:attribute name="entity-name" use="required"/>
|
||||
<xs:attribute name="actions" use="required"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="context" use="required"/> <!--the JACC contextID-->
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="property">
|
||||
<xs:complexType mixed="true">
|
||||
<xs:attributeGroup ref="config:attlist.property"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:attributeGroup name="attlist.property">
|
||||
<xs:attribute name="name" use="required"/>
|
||||
</xs:attributeGroup>
|
||||
<xs:element name="mapping">
|
||||
<xs:complexType>
|
||||
<xs:attributeGroup ref="config:attlist.mapping"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<!-- reference to a mapping file -->
|
||||
<xs:attributeGroup name="attlist.mapping">
|
||||
<xs:attribute name="resource"/>
|
||||
<xs:attribute name="file"/>
|
||||
<xs:attribute name="jar"/>
|
||||
<xs:attribute name="package"/>
|
||||
<xs:attribute name="class"/>
|
||||
</xs:attributeGroup>
|
||||
<xs:element name="class-cache">
|
||||
<xs:complexType>
|
||||
<xs:attributeGroup ref="config:attlist.class-cache"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:attributeGroup name="attlist.class-cache">
|
||||
<xs:attribute name="class" use="required"/>
|
||||
<xs:attribute name="region"/>
|
||||
<xs:attribute name="usage" use="required">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:enumeration value="read-only"/>
|
||||
<xs:enumeration value="read-write"/>
|
||||
<xs:enumeration value="nonstrict-read-write"/>
|
||||
<xs:enumeration value="transactional"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="include" default="all">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:enumeration value="all"/>
|
||||
<xs:enumeration value="non-lazy"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
</xs:attributeGroup>
|
||||
<xs:element name="collection-cache">
|
||||
<xs:complexType>
|
||||
<xs:attributeGroup ref="config:attlist.collection-cache"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:attributeGroup name="attlist.collection-cache">
|
||||
<xs:attribute name="collection" use="required"/>
|
||||
<xs:attribute name="region"/>
|
||||
<xs:attribute name="usage" use="required">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:enumeration value="read-only"/>
|
||||
<xs:enumeration value="read-write"/>
|
||||
<xs:enumeration value="nonstrict-read-write"/>
|
||||
<xs:enumeration value="transactional"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
</xs:attributeGroup>
|
||||
<xs:element name="event">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" ref="config:listener"/>
|
||||
</xs:sequence>
|
||||
<xs:attributeGroup ref="config:attlist.event"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:attributeGroup name="attlist.event">
|
||||
<xs:attribute name="type" use="required">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:enumeration value="auto-flush"/>
|
||||
<xs:enumeration value="merge"/>
|
||||
<xs:enumeration value="create"/>
|
||||
<xs:enumeration value="create-onflush"/>
|
||||
<xs:enumeration value="delete"/>
|
||||
<xs:enumeration value="dirty-check"/>
|
||||
<xs:enumeration value="evict"/>
|
||||
<xs:enumeration value="flush"/>
|
||||
<xs:enumeration value="flush-entity"/>
|
||||
<xs:enumeration value="load"/>
|
||||
<xs:enumeration value="load-collection"/>
|
||||
<xs:enumeration value="lock"/>
|
||||
<xs:enumeration value="refresh"/>
|
||||
<xs:enumeration value="replicate"/>
|
||||
<xs:enumeration value="save-update"/>
|
||||
<xs:enumeration value="save"/>
|
||||
<xs:enumeration value="update"/>
|
||||
<xs:enumeration value="pre-load"/>
|
||||
<xs:enumeration value="pre-update"/>
|
||||
<xs:enumeration value="pre-insert"/>
|
||||
<xs:enumeration value="pre-delete"/>
|
||||
<xs:enumeration value="pre-collection-recreate"/>
|
||||
<xs:enumeration value="pre-collection-remove"/>
|
||||
<xs:enumeration value="pre-collection-update"/>
|
||||
<xs:enumeration value="post-load"/>
|
||||
<xs:enumeration value="post-update"/>
|
||||
<xs:enumeration value="post-insert"/>
|
||||
<xs:enumeration value="post-delete"/>
|
||||
<xs:enumeration value="post-collection-recreate"/>
|
||||
<xs:enumeration value="post-collection-remove"/>
|
||||
<xs:enumeration value="post-collection-update"/>
|
||||
<xs:enumeration value="post-commit-update"/>
|
||||
<xs:enumeration value="post-commit-insert"/>
|
||||
<xs:enumeration value="post-commit-delete"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
</xs:attributeGroup>
|
||||
<xs:element name="listener">
|
||||
<xs:complexType>
|
||||
<xs:attributeGroup ref="config:attlist.listener"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:attributeGroup name="attlist.listener">
|
||||
<xs:attribute name="type">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:enumeration value="auto-flush"/>
|
||||
<xs:enumeration value="merge"/>
|
||||
<xs:enumeration value="create"/>
|
||||
<xs:enumeration value="create-onflush"/>
|
||||
<xs:enumeration value="delete"/>
|
||||
<xs:enumeration value="dirty-check"/>
|
||||
<xs:enumeration value="evict"/>
|
||||
<xs:enumeration value="flush"/>
|
||||
<xs:enumeration value="flush-entity"/>
|
||||
<xs:enumeration value="load"/>
|
||||
<xs:enumeration value="load-collection"/>
|
||||
<xs:enumeration value="lock"/>
|
||||
<xs:enumeration value="refresh"/>
|
||||
<xs:enumeration value="replicate"/>
|
||||
<xs:enumeration value="save-update"/>
|
||||
<xs:enumeration value="save"/>
|
||||
<xs:enumeration value="update"/>
|
||||
<xs:enumeration value="pre-load"/>
|
||||
<xs:enumeration value="pre-update"/>
|
||||
<xs:enumeration value="pre-insert"/>
|
||||
<xs:enumeration value="pre-delete"/>
|
||||
<xs:enumeration value="pre-collection-recreate"/>
|
||||
<xs:enumeration value="pre-collection-remove"/>
|
||||
<xs:enumeration value="pre-collection-update"/>
|
||||
<xs:enumeration value="post-load"/>
|
||||
<xs:enumeration value="post-update"/>
|
||||
<xs:enumeration value="post-insert"/>
|
||||
<xs:enumeration value="post-delete"/>
|
||||
<xs:enumeration value="post-collection-recreate"/>
|
||||
<xs:enumeration value="post-collection-remove"/>
|
||||
<xs:enumeration value="post-collection-update"/>
|
||||
<xs:enumeration value="post-commit-update"/>
|
||||
<xs:enumeration value="post-commit-insert"/>
|
||||
<xs:enumeration value="post-commit-delete"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="class" use="required"/>
|
||||
</xs:attributeGroup>
|
||||
<xs:element name="session-factory">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" ref="config:property"/>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" ref="config:mapping"/>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element ref="config:class-cache"/>
|
||||
<xs:element ref="config:collection-cache"/>
|
||||
</xs:choice>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" ref="config:event"/>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" ref="config:listener"/>
|
||||
</xs:sequence>
|
||||
<xs:attributeGroup ref="config:attlist.session-factory"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:attributeGroup name="attlist.session-factory">
|
||||
<xs:attribute name="name"/>
|
||||
</xs:attributeGroup>
|
||||
<!-- the JNDI name -->
|
||||
<xs:element name="security">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element minOccurs="0" maxOccurs="unbounded" ref="config:grant"/>
|
||||
</xs:sequence>
|
||||
<xs:attributeGroup ref="config:attlist.security"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:attributeGroup name="attlist.security">
|
||||
<xs:attribute name="context" use="required"/>
|
||||
</xs:attributeGroup>
|
||||
<!-- the JACC contextID -->
|
||||
<xs:element name="grant">
|
||||
<xs:complexType>
|
||||
<xs:attributeGroup ref="config:attlist.grant"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:attributeGroup name="attlist.grant">
|
||||
<xs:attribute name="role" use="required"/>
|
||||
<xs:attribute name="entity-name" use="required"/>
|
||||
<xs:attribute name="actions" use="required"/>
|
||||
</xs:attributeGroup>
|
||||
|
||||
<xs:complexType name="listenerType">
|
||||
<xs:attribute ref="type"/>
|
||||
<xs:attribute ref="class" use="required"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:attribute name="class"/>
|
||||
|
||||
<xs:attribute name="region"/>
|
||||
|
||||
<xs:attribute name="usage">
|
||||
</xs:attribute>
|
||||
|
||||
<xs:attribute name="type">
|
||||
</xs:attribute>
|
||||
|
||||
</xs:schema>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -14,6 +14,18 @@
|
|||
<jxb:anonymousTypeName prefix="XML"/>
|
||||
</jxb:nameXmlTransform>
|
||||
</jxb:schemaBindings>
|
||||
<jxb:bindings node=".//xs:attribute[@name='subselect']">
|
||||
<jxb:property name="subselectAttribute"/>
|
||||
</jxb:bindings>
|
||||
<jxb:bindings node=".//xs:attribute[@name='column']">
|
||||
<jxb:property name="columnAttribute"/>
|
||||
</jxb:bindings>
|
||||
<jxb:bindings node=".//xs:attribute[@name='type']">
|
||||
<jxb:property name="typeAttribute"/>
|
||||
</jxb:bindings>
|
||||
<jxb:bindings node=".//xs:attribute[@name='formula']">
|
||||
<jxb:property name="formulaAttribute"/>
|
||||
</jxb:bindings>
|
||||
</jxb:bindings>
|
||||
|
||||
</jxb:bindings>
|
Loading…
Reference in New Issue