HHH-7448 hbm mapping xsd improve
This commit is contained in:
parent
6b4b91ccc7
commit
ef168c1f5d
|
@ -1216,26 +1216,27 @@ public final class SessionFactoryImpl
|
|||
null
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamedQueryDefinition getNamedQuery(String queryName) {
|
||||
return namedQueries.get( queryName );
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamedSQLQueryDefinition getNamedSQLQuery(String queryName) {
|
||||
return namedSqlQueries.get( queryName );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultSetMappingDefinition getResultSetMapping(String resultSetName) {
|
||||
return sqlResultSetMappings.get( resultSetName );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getIdentifierType(String className) throws MappingException {
|
||||
return getEntityPersister(className).getIdentifierType();
|
||||
}
|
||||
@Override
|
||||
public String getIdentifierPropertyName(String className) throws MappingException {
|
||||
return getEntityPersister(className).getIdentifierPropertyName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type[] getReturnTypes(String queryString) throws HibernateException {
|
||||
return queryPlanCache.getHQLQueryPlan( queryString, false, Collections.EMPTY_MAP )
|
||||
.getReturnMetadata()
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* 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
|
||||
*/
|
||||
package org.hibernate.internal.jaxb.mapping.hbm;
|
||||
|
||||
/**
|
||||
* @author Steve Ebersole
|
||||
*/
|
||||
public interface CustomSqlElement {
|
||||
public String getValue();
|
||||
public boolean isCallable();
|
||||
public JaxbCheckAttribute getCheck();
|
||||
}
|
|
@ -32,10 +32,10 @@ public interface EntityElement extends MetaAttributeContainer {
|
|||
public String getName();
|
||||
public String getEntityName();
|
||||
|
||||
public Boolean isAbstract();
|
||||
public Boolean isLazy();
|
||||
public boolean isAbstract();
|
||||
public boolean isLazy();
|
||||
public String getProxy();
|
||||
public String getBatchSize();
|
||||
public int getBatchSize();
|
||||
public boolean isDynamicInsert();
|
||||
public boolean isDynamicUpdate();
|
||||
public boolean isSelectBeforeUpdate();
|
||||
|
@ -44,9 +44,9 @@ public interface EntityElement extends MetaAttributeContainer {
|
|||
public String getPersister();
|
||||
|
||||
public JaxbLoaderElement getLoader();
|
||||
public JaxbSqlInsertElement getSqlInsert();
|
||||
public JaxbSqlUpdateElement getSqlUpdate();
|
||||
public JaxbSqlDeleteElement getSqlDelete();
|
||||
public JaxbSqlDmlElement getSqlInsert();
|
||||
public JaxbSqlDmlElement getSqlUpdate();
|
||||
public JaxbSqlDmlElement getSqlDelete();
|
||||
|
||||
public List<JaxbSynchronizeElement> getSynchronize();
|
||||
|
||||
|
|
|
@ -47,10 +47,10 @@ public interface PluralAttributeElement extends TableInformationSource, MetaAttr
|
|||
public String getWhere();
|
||||
|
||||
public JaxbLoaderElement getLoader();
|
||||
public JaxbSqlInsertElement getSqlInsert();
|
||||
public JaxbSqlUpdateElement getSqlUpdate();
|
||||
public JaxbSqlDeleteElement getSqlDelete();
|
||||
public JaxbSqlDeleteAllElement getSqlDeleteAll();
|
||||
public JaxbSqlDmlElement getSqlInsert();
|
||||
public JaxbSqlDmlElement getSqlUpdate();
|
||||
public JaxbSqlDmlElement getSqlDelete();
|
||||
public JaxbSqlDmlElement getSqlDeleteAll();
|
||||
|
||||
public List<JaxbSynchronizeElement> getSynchronize();
|
||||
|
||||
|
@ -62,7 +62,7 @@ public interface PluralAttributeElement extends TableInformationSource, MetaAttr
|
|||
public JaxbLazyAttributeWithExtra getLazy();
|
||||
public JaxbOuterJoinAttribute getOuterJoin();
|
||||
|
||||
public String getBatchSize();
|
||||
public int getBatchSize();
|
||||
public boolean isInverse();
|
||||
public boolean isMutable();
|
||||
public boolean isOptimisticLock();
|
||||
|
|
|
@ -252,12 +252,12 @@ public abstract class AbstractEntitySourceImpl
|
|||
|
||||
@Override
|
||||
public boolean isAbstract() {
|
||||
return Helper.getBooleanValue( entityElement.isAbstract(), false );
|
||||
return entityElement().isAbstract();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLazy() {
|
||||
return Helper.getBooleanValue( entityElement.isAbstract(), true );
|
||||
return entityElement().isLazy();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -267,7 +267,7 @@ public abstract class AbstractEntitySourceImpl
|
|||
|
||||
@Override
|
||||
public int getBatchSize() {
|
||||
return Helper.getIntValue( entityElement.getBatchSize(), -1 );
|
||||
return entityElement.getBatchSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -300,7 +300,7 @@ public abstract class AbstractPluralAttributeSourceImpl
|
|||
final String outerJoinSelection = pluralAttributeElement.getOuterJoin() != null
|
||||
? pluralAttributeElement.getOuterJoin().value()
|
||||
: null;
|
||||
final int batchSize = Helper.getIntValue( pluralAttributeElement.getBatchSize(), -1 );
|
||||
final int batchSize = pluralAttributeElement.getBatchSize();
|
||||
|
||||
if ( fetchSelection == null ) {
|
||||
if ( outerJoinSelection == null ) {
|
||||
|
|
|
@ -98,9 +98,9 @@ class ColumnSourceImpl
|
|||
@Override
|
||||
public Size getSize() {
|
||||
return new Size(
|
||||
Helper.getIntValue( columnElement.getPrecision(), -1 ),
|
||||
Helper.getIntValue( columnElement.getScale(), -1 ),
|
||||
Helper.getLongValue( columnElement.getLength(), -1 ),
|
||||
Helper.getValue( columnElement.getPrecision(), -1 ),
|
||||
Helper.getValue( columnElement.getScale(), -1 ),
|
||||
Helper.getValue( columnElement.getLength(), -1 ),
|
||||
Size.LobMultiplier.NONE
|
||||
);
|
||||
}
|
||||
|
|
|
@ -30,18 +30,21 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.TruthValue;
|
||||
import org.hibernate.cache.spi.access.AccessType;
|
||||
import org.hibernate.engine.spi.CascadeStyle;
|
||||
import org.hibernate.engine.spi.ExecuteUpdateResultCheckStyle;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement;
|
||||
import org.hibernate.internal.jaxb.Origin;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.EntityElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbCacheElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbColumnElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbJoinedSubclassElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbLockModeAttribute;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbMetaElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbNaturalIdCacheElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbParamElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbSqlDmlElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbSubclassElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbUnionSubclassElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.TableInformationSource;
|
||||
|
@ -80,6 +83,36 @@ public class Helper {
|
|||
}
|
||||
};
|
||||
|
||||
public static LockMode interpretLockMode(JaxbLockModeAttribute lockModeAttribute, Origin origin){
|
||||
if(lockModeAttribute==null)return LockMode.READ;
|
||||
switch ( lockModeAttribute ) {
|
||||
case NONE:
|
||||
return LockMode.NONE;
|
||||
case UPGRADE:
|
||||
return LockMode.UPGRADE;
|
||||
case UPGRADE_NOWAIT:
|
||||
return LockMode.UPGRADE_NOWAIT;
|
||||
case READ:
|
||||
return LockMode.READ;
|
||||
case WRITE:
|
||||
return LockMode.WRITE;
|
||||
case FORCE:
|
||||
return LockMode.FORCE;
|
||||
case OPTIMISTIC:
|
||||
return LockMode.OPTIMISTIC;
|
||||
case OPTIMISTIC_FORCE_INCREMENT:
|
||||
return LockMode.OPTIMISTIC_FORCE_INCREMENT;
|
||||
case PESSIMISTIC_READ:
|
||||
return LockMode.PESSIMISTIC_READ;
|
||||
case PESSIMISTIC_WRITE:
|
||||
return LockMode.PESSIMISTIC_WRITE;
|
||||
case PESSIMISTIC_FORCE_INCREMENT:
|
||||
return LockMode.PESSIMISTIC_FORCE_INCREMENT;
|
||||
default:
|
||||
throw new MappingException( "unknown lock mode: "+lockModeAttribute, origin );
|
||||
}
|
||||
}
|
||||
|
||||
public static InheritanceType interpretInheritanceType(EntityElement entityElement) {
|
||||
if ( JaxbSubclassElement.class.isInstance( entityElement ) ) {
|
||||
return InheritanceType.SINGLE_TABLE;
|
||||
|
@ -102,7 +135,7 @@ public class Helper {
|
|||
*
|
||||
* @return The {@link CustomSQL} representation
|
||||
*/
|
||||
public static CustomSQL buildCustomSql(CustomSqlElement customSqlElement) {
|
||||
public static CustomSQL buildCustomSql(JaxbSqlDmlElement customSqlElement) {
|
||||
if ( customSqlElement == null ) {
|
||||
return null;
|
||||
}
|
||||
|
@ -148,12 +181,8 @@ public class Helper {
|
|||
}
|
||||
final String region;
|
||||
if ( StringHelper.isEmpty( cacheElement.getRegion() ) ) {
|
||||
if ( entityCache != null ) {
|
||||
region = entityCache.getRegion() + NATURAL_ID_CACHE_SUFFIX;
|
||||
}
|
||||
else {
|
||||
region = entityName + NATURAL_ID_CACHE_SUFFIX;
|
||||
}
|
||||
String temp = entityCache != null ? entityCache.getRegion() : entityName;
|
||||
region = temp + NATURAL_ID_CACHE_SUFFIX;
|
||||
}
|
||||
else {
|
||||
region = cacheElement.getRegion();
|
||||
|
@ -183,7 +212,7 @@ public class Helper {
|
|||
}
|
||||
|
||||
public static String getPropertyAccessorName(String access, boolean isEmbedded, String defaultAccess) {
|
||||
return getStringValue( access, isEmbedded ? "embedded" : defaultAccess );
|
||||
return getValue( access, isEmbedded ? "embedded" : defaultAccess );
|
||||
}
|
||||
|
||||
public static MetaAttributeContext extractMetaAttributeContext(
|
||||
|
@ -210,19 +239,7 @@ public class Helper {
|
|||
return subContext;
|
||||
}
|
||||
|
||||
public static String getStringValue(String value, String defaultValue) {
|
||||
return value == null ? defaultValue : value;
|
||||
}
|
||||
|
||||
public static int getIntValue(String value, int defaultValue) {
|
||||
return value == null ? defaultValue : Integer.parseInt( value );
|
||||
}
|
||||
|
||||
public static long getLongValue(String value, long defaultValue) {
|
||||
return value == null ? defaultValue : Long.parseLong( value );
|
||||
}
|
||||
|
||||
public static boolean getBooleanValue(Boolean value, boolean defaultValue) {
|
||||
public static <T> T getValue(T value, T defaultValue){
|
||||
return value == null ? defaultValue : value;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,23 +23,47 @@
|
|||
*/
|
||||
package org.hibernate.metamodel.internal.source.hbm;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hibernate.CacheMode;
|
||||
import org.hibernate.FlushMode;
|
||||
import org.hibernate.LockMode;
|
||||
import org.hibernate.bytecode.buildtime.spi.Logger;
|
||||
import org.hibernate.cfg.HbmBinder;
|
||||
import org.hibernate.engine.ResultSetMappingDefinition;
|
||||
import org.hibernate.engine.query.spi.sql.NativeSQLQueryJoinReturn;
|
||||
import org.hibernate.engine.query.spi.sql.NativeSQLQueryReturn;
|
||||
import org.hibernate.engine.query.spi.sql.NativeSQLQueryRootReturn;
|
||||
import org.hibernate.engine.query.spi.sql.NativeSQLQueryScalarReturn;
|
||||
import org.hibernate.engine.spi.NamedQueryDefinition;
|
||||
import org.hibernate.engine.spi.NamedSQLQueryDefinition;
|
||||
import org.hibernate.internal.CoreMessageLogger;
|
||||
import org.hibernate.internal.jaxb.Origin;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.EntityElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbFetchProfileElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbHibernateMapping.JaxbImport;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbLoadCollectionElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbQueryElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbQueryParamElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbResultsetElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbReturnElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbReturnJoinElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbReturnScalarElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbSqlQueryElement;
|
||||
import org.hibernate.internal.jaxb.mapping.hbm.JaxbSynchronizeElement;
|
||||
import org.hibernate.internal.util.StringHelper;
|
||||
import org.hibernate.internal.util.Value;
|
||||
import org.hibernate.internal.util.collections.CollectionHelper;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.metamodel.spi.binding.EntityBinding;
|
||||
import org.hibernate.metamodel.spi.binding.FetchProfile;
|
||||
import org.hibernate.metamodel.spi.relational.AuxiliaryDatabaseObject;
|
||||
import org.hibernate.metamodel.spi.relational.BasicAuxiliaryDatabaseObjectImpl;
|
||||
|
@ -49,6 +73,7 @@ import org.hibernate.metamodel.spi.source.MetadataImplementor;
|
|||
import org.hibernate.metamodel.spi.source.TypeDescriptorSource;
|
||||
import org.hibernate.service.classloading.spi.ClassLoaderService;
|
||||
import org.hibernate.service.classloading.spi.ClassLoadingException;
|
||||
import org.hibernate.type.Type;
|
||||
|
||||
/**
|
||||
* Responsible for processing a {@code <hibernate-mapping/>} element. Allows processing to be coordinated across
|
||||
|
@ -56,8 +81,13 @@ import org.hibernate.service.classloading.spi.ClassLoadingException;
|
|||
* {@link org.hibernate.metamodel.spi.MetadataSourceProcessor}
|
||||
*
|
||||
* @author Steve Ebersole
|
||||
* @author Strong Liu
|
||||
*/
|
||||
public class HibernateMappingProcessor {
|
||||
private static final CoreMessageLogger LOG = org.jboss
|
||||
.logging
|
||||
.Logger
|
||||
.getMessageLogger( CoreMessageLogger.class, HibernateMappingProcessor.class.getName() );
|
||||
private final MetadataImplementor metadata;
|
||||
private final MappingDocument mappingDocument;
|
||||
|
||||
|
@ -241,21 +271,141 @@ public class HibernateMappingProcessor {
|
|||
}
|
||||
|
||||
private void bindResultSetMappingDefinitions(JaxbResultsetElement element) {
|
||||
ResultSetMappingDefinition definition = new ResultSetMappingDefinition( element.getName() );
|
||||
final ResultSetMappingDefinition definition = new ResultSetMappingDefinition( element.getName() );
|
||||
final List returns = element.getReturnScalarOrReturnOrReturnJoin();
|
||||
int cnt=0;
|
||||
for ( final Object obj : returns ) {
|
||||
cnt++;
|
||||
final NativeSQLQueryReturn nativeSQLQueryReturn;
|
||||
if ( JaxbReturnScalarElement.class.isInstance( obj ) ) {
|
||||
JaxbReturnScalarElement scalarElement = JaxbReturnScalarElement.class.cast( obj );
|
||||
String column = scalarElement.getColumn();
|
||||
String typeFromXML = scalarElement.getType();
|
||||
Type type = metadata.getTypeResolver().heuristicType( typeFromXML );
|
||||
nativeSQLQueryReturn = new NativeSQLQueryScalarReturn( column, type );
|
||||
}
|
||||
else if ( JaxbReturnJoinElement.class.isInstance( obj ) ) {
|
||||
nativeSQLQueryReturn = bindReturnJoin(JaxbReturnJoinElement.class.cast( obj ), cnt);
|
||||
|
||||
}
|
||||
else if ( JaxbLoadCollectionElement.class.isInstance( obj ) ) {
|
||||
nativeSQLQueryReturn = bindLoadCollection(JaxbLoadCollectionElement.class.cast( obj ), cnt);
|
||||
}
|
||||
else if ( JaxbReturnElement.class.isInstance( obj ) ) {
|
||||
nativeSQLQueryReturn= bindReturn(JaxbReturnElement.class.cast( obj ), cnt);
|
||||
|
||||
}else {
|
||||
throw new MappingException( "unknown type of Result set mapping return: "+obj.getClass().getName() , origin());
|
||||
}
|
||||
definition.addQueryReturn( nativeSQLQueryReturn );
|
||||
}
|
||||
metadata.addResultSetMapping( definition );
|
||||
|
||||
}
|
||||
|
||||
private NativeSQLQueryReturn bindLoadCollection(JaxbLoadCollectionElement returnElement, int cnt) {
|
||||
final String alias = returnElement.getAlias();
|
||||
final String collectionAttribute = returnElement.getRole();
|
||||
final LockMode lockMode = Helper.interpretLockMode( returnElement.getLockMode(), origin() );
|
||||
int dot = collectionAttribute.lastIndexOf( '.' );
|
||||
if ( dot == -1 ) {
|
||||
throw new MappingException(
|
||||
"Collection attribute for sql query return [alias=" + alias +
|
||||
"] not formatted correctly {OwnerClassName.propertyName}", origin()
|
||||
);
|
||||
}
|
||||
final String ownerClassName = HbmBinder.getClassName( collectionAttribute.substring( 0, dot ), bindingContext().getMappingDefaults().getPackageName() );
|
||||
final String ownerPropertyName = collectionAttribute.substring( dot + 1 );
|
||||
|
||||
// //FIXME: get the PersistentClass
|
||||
// java.util.Map propertyResults = bindPropertyResults(alias, returnElem, null, mappings );
|
||||
//
|
||||
// return new NativeSQLQueryCollectionReturn(
|
||||
// alias,
|
||||
// ownerClassName,
|
||||
// ownerPropertyName,
|
||||
// propertyResults,
|
||||
// lockMode
|
||||
// );
|
||||
return null;
|
||||
}
|
||||
|
||||
private NativeSQLQueryReturn bindReturnJoin(JaxbReturnJoinElement returnJoinElement, int cnt) {
|
||||
final String alias = returnJoinElement.getAlias();
|
||||
final String roleAttribute = returnJoinElement.getProperty();
|
||||
final LockMode lockMode = Helper.interpretLockMode( returnJoinElement.getLockMode(), origin() );
|
||||
int dot = roleAttribute.lastIndexOf( '.' );
|
||||
if ( dot == -1 ) {
|
||||
throw new MappingException(
|
||||
"Role attribute for sql query return [alias=" + alias +
|
||||
"] not formatted correctly {owningAlias.propertyName}", origin()
|
||||
);
|
||||
}
|
||||
String roleOwnerAlias = roleAttribute.substring( 0, dot );
|
||||
String roleProperty = roleAttribute.substring( dot + 1 );
|
||||
|
||||
//FIXME: get the PersistentClass
|
||||
// java.util.Map propertyResults = bindPropertyResults( alias, returnJoinElement, null );
|
||||
|
||||
// return new NativeSQLQueryJoinReturn(
|
||||
// alias,
|
||||
// roleOwnerAlias,
|
||||
// roleProperty,
|
||||
// propertyResults, // TODO: bindpropertyresults(alias, returnElem)
|
||||
// lockMode
|
||||
// );
|
||||
return null;
|
||||
}
|
||||
|
||||
private NativeSQLQueryRootReturn bindReturn(JaxbReturnElement returnElement,int elementCount) {
|
||||
String alias = returnElement.getAlias();
|
||||
if( StringHelper.isEmpty( alias )) {
|
||||
alias = "alias_" + elementCount; // hack/workaround as sqlquery impl depend on having a key.
|
||||
}
|
||||
String clazz = returnElement.getClazz();
|
||||
String entityName = returnElement.getEntityName();
|
||||
if(StringHelper.isEmpty( clazz ) && StringHelper.isEmpty( entityName )) {
|
||||
throw new org.hibernate.MappingException( "<return alias='" + alias + "'> must specify either a class or entity-name");
|
||||
}
|
||||
LockMode lockMode = Helper.interpretLockMode( returnElement.getLockMode(), origin() );
|
||||
|
||||
|
||||
EntityBinding entityBinding = null;
|
||||
|
||||
if ( StringHelper.isNotEmpty( entityName ) ) {
|
||||
entityBinding = metadata.getEntityBinding( entityName );
|
||||
}
|
||||
if ( StringHelper.isNotEmpty( clazz ) ) {
|
||||
//todo look up entitybinding by class name
|
||||
}
|
||||
java.util.Map<String, String[]> propertyResults = bindPropertyResults( alias, returnElement, entityBinding );
|
||||
|
||||
return new NativeSQLQueryRootReturn(
|
||||
alias,
|
||||
entityName,
|
||||
propertyResults,
|
||||
lockMode
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
//TODO impl this, see org.hibernate.metamodel.internal.source.annotations.global.SqlResultSetProcessor.bindEntityResult()
|
||||
// and org.hibernate.cfg.ResultSetMappingBinder.bindPropertyResults()
|
||||
private Map<String, String[]> bindPropertyResults(String alias, JaxbReturnElement returnElement, EntityBinding entityBinding) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void processNamedQueries() {
|
||||
if ( mappingRoot().getQueryOrSqlQuery() == null ) {
|
||||
if ( CollectionHelper.isEmpty( mappingRoot().getQueryOrSqlQuery() ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
for ( Object queryOrSqlQuery : mappingRoot().getQueryOrSqlQuery() ) {
|
||||
if ( JaxbQueryElement.class.isInstance( queryOrSqlQuery ) ) {
|
||||
// bindNamedQuery( element, null, mappings );
|
||||
bindNamedQuery( JaxbQueryElement.class.cast( queryOrSqlQuery ) );
|
||||
}
|
||||
else if ( JaxbSqlQueryElement.class.isInstance( queryOrSqlQuery ) ) {
|
||||
// bindNamedSQLQuery( element, null, mappings );
|
||||
bindNamedSQLQuery( JaxbSqlQueryElement.class.cast( queryOrSqlQuery ) );
|
||||
}
|
||||
else {
|
||||
throw new MappingException(
|
||||
|
@ -265,4 +415,152 @@ public class HibernateMappingProcessor {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void bindNamedQuery(JaxbQueryElement queryElement) {
|
||||
final String queryName = queryElement.getName();
|
||||
//path??
|
||||
List<Serializable> list = queryElement.getContent();
|
||||
final Map<String, String> queryParam;
|
||||
String query = "";
|
||||
if ( CollectionHelper.isNotEmpty( list ) ) {
|
||||
queryParam = new HashMap<String, String>( list.size() );
|
||||
for ( Serializable obj : list ) {
|
||||
if ( JaxbQueryParamElement.class.isInstance( obj ) ) {
|
||||
JaxbQueryParamElement element = JaxbQueryParamElement.class.cast( obj );
|
||||
queryParam.put( element.getName(), element.getType() );
|
||||
}else if(String.class.isInstance( obj )){
|
||||
query = obj.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
queryParam = Collections.emptyMap();
|
||||
}
|
||||
if ( StringHelper.isEmpty( query ) ) {
|
||||
throw new MappingException( "Named query[" + queryName + "] has no hql defined", origin() );
|
||||
}
|
||||
final boolean cacheable = queryElement.isCacheable();
|
||||
final String region = queryElement.getCacheRegion();
|
||||
final Integer timeout = queryElement.getTimeout();
|
||||
final Integer fetchSize = queryElement.getFetchSize();
|
||||
final boolean readonly = queryElement.isReadOnly();
|
||||
final CacheMode cacheMode = queryElement.getCacheMode() == null ? null : CacheMode.valueOf(
|
||||
queryElement.getCacheMode()
|
||||
.value()
|
||||
.toUpperCase()
|
||||
);
|
||||
final String comment = queryElement.getComment();
|
||||
final FlushMode flushMode = queryElement.getFlushMode() == null ? null : FlushMode.valueOf(
|
||||
queryElement.getFlushMode()
|
||||
.value()
|
||||
.toUpperCase()
|
||||
);
|
||||
NamedQueryDefinition namedQuery = new NamedQueryDefinition(
|
||||
queryName,
|
||||
query,
|
||||
cacheable,
|
||||
region,
|
||||
timeout,
|
||||
fetchSize,
|
||||
flushMode,
|
||||
cacheMode,
|
||||
readonly,
|
||||
comment,
|
||||
queryParam
|
||||
);
|
||||
metadata.addNamedQuery( namedQuery );
|
||||
|
||||
}
|
||||
|
||||
private void bindNamedSQLQuery(JaxbSqlQueryElement queryElement) {
|
||||
final String queryName = queryElement.getName();
|
||||
//todo patch
|
||||
final boolean cacheable = queryElement.isCacheable();
|
||||
String query = "";
|
||||
final String region = queryElement.getCacheRegion();
|
||||
final Integer timeout = queryElement.getTimeout();
|
||||
final Integer fetchSize = queryElement.getFetchSize();
|
||||
final boolean readonly = queryElement.isReadOnly();
|
||||
final CacheMode cacheMode = queryElement.getCacheMode()==null ? null : CacheMode.valueOf( queryElement.getCacheMode().value().toUpperCase() );
|
||||
final FlushMode flushMode = queryElement.getFlushMode() ==null ? null : FlushMode.valueOf( queryElement.getFlushMode().value().toUpperCase() );
|
||||
final String comment = queryElement.getComment();
|
||||
final boolean callable = queryElement.isCallable();
|
||||
final String resultSetRef = queryElement.getResultsetRef();
|
||||
final java.util.List<String> synchronizedTables = new ArrayList<String>();
|
||||
final Map<String, String> queryParam = new HashMap<String, String>( );
|
||||
List<Serializable> list = queryElement.getContent();
|
||||
for ( Serializable obj : list ) {
|
||||
if ( JaxbSynchronizeElement.class.isInstance( obj ) ) {
|
||||
JaxbSynchronizeElement element = JaxbSynchronizeElement.class.cast( obj );
|
||||
synchronizedTables.add( element.getTable() );
|
||||
}
|
||||
else if ( JaxbQueryParamElement.class.isInstance( obj ) ) {
|
||||
JaxbQueryParamElement element = JaxbQueryParamElement.class.cast( obj );
|
||||
queryParam.put( element.getName(), element.getType() );
|
||||
}
|
||||
else if ( JaxbLoadCollectionElement.class.isInstance( obj ) ) {
|
||||
|
||||
}
|
||||
else if ( JaxbReturnScalarElement.class.isInstance( obj ) ) {
|
||||
|
||||
}
|
||||
else if ( JaxbReturnElement.class.isInstance( obj ) ) {
|
||||
|
||||
}
|
||||
else if ( JaxbReturnJoinElement.class.isInstance( obj ) ) {
|
||||
|
||||
}
|
||||
else if ( String.class.isInstance( obj ) ){
|
||||
query = obj.toString();
|
||||
}
|
||||
|
||||
}
|
||||
if ( StringHelper.isEmpty( query ) ) {
|
||||
throw new MappingException( "Named sql query[" + queryName + "] has no sql defined", origin() );
|
||||
}
|
||||
NamedSQLQueryDefinition namedQuery=null;
|
||||
if(StringHelper.isNotEmpty( resultSetRef )){
|
||||
namedQuery = new NamedSQLQueryDefinition(
|
||||
queryName,
|
||||
query,
|
||||
resultSetRef,
|
||||
synchronizedTables,
|
||||
cacheable,
|
||||
region,
|
||||
timeout,
|
||||
fetchSize,
|
||||
flushMode,
|
||||
cacheMode,
|
||||
readonly,
|
||||
comment,
|
||||
queryParam,
|
||||
callable
|
||||
);
|
||||
//TODO check there is no actual definition elemnents when a ref is defined
|
||||
} else {
|
||||
// ResultSetMappingDefinition definition = buildResultSetMappingDefinition( queryElem, path, mappings );
|
||||
// namedQuery = new NamedSQLQueryDefinition(
|
||||
// queryName,
|
||||
// query,
|
||||
// definition.getQueryReturns(),
|
||||
// synchronizedTables,
|
||||
// cacheable,
|
||||
// region,
|
||||
// timeout,
|
||||
// fetchSize,
|
||||
// flushMode,
|
||||
// cacheMode,
|
||||
// readonly,
|
||||
// comment,
|
||||
// queryParam,
|
||||
// callable
|
||||
// );
|
||||
|
||||
}
|
||||
if ( LOG.isDebugEnabled() ) {
|
||||
LOG.debugf( "Named SQL query: %s -> %s", namedQuery.getName(), namedQuery.getQueryString() );
|
||||
}
|
||||
metadata.addNamedNativeQuery( namedQuery );
|
||||
|
||||
}
|
||||
}
|
|
@ -239,7 +239,7 @@ class ManyToOneAttributeSourceImpl extends AbstractHbmSourceNode implements ToOn
|
|||
|
||||
@Override
|
||||
public boolean areValuesNullableByDefault() {
|
||||
return ! Helper.getBooleanValue( manyToOneElement.isNotNull(), false );
|
||||
return ! Helper.getValue( manyToOneElement.isNotNull(), false );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -64,7 +64,7 @@ public class PluralAttributeKeySourceImpl
|
|||
|
||||
@Override
|
||||
public boolean isIncludedInUpdateByDefault() {
|
||||
return Helper.getBooleanValue( keyElement.isUpdate(), true );
|
||||
return Helper.getValue( keyElement.isUpdate(), true );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -84,7 +84,7 @@ public class PluralAttributeKeySourceImpl
|
|||
|
||||
@Override
|
||||
public boolean isForceNotNull() {
|
||||
return Helper.getBooleanValue( keyElement.isNotNull(), false );
|
||||
return Helper.getValue( keyElement.isNotNull(), false );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
|
@ -98,12 +98,12 @@ class PropertyAttributeSourceImpl extends AbstractHbmSourceNode implements Singu
|
|||
|
||||
@Override
|
||||
public boolean isIncludedInInsertByDefault() {
|
||||
return Helper.getBooleanValue( propertyElement.isInsert(), true );
|
||||
return Helper.getValue( propertyElement.isInsert(), true );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIncludedInUpdateByDefault() {
|
||||
return Helper.getBooleanValue( propertyElement.isUpdate(), true );
|
||||
return Helper.getValue( propertyElement.isUpdate(), true );
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -132,7 +132,7 @@ class PropertyAttributeSourceImpl extends AbstractHbmSourceNode implements Singu
|
|||
|
||||
@Override
|
||||
public boolean isLazy() {
|
||||
return Helper.getBooleanValue( propertyElement.isLazy(), false );
|
||||
return Helper.getValue( propertyElement.isLazy(), false );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -142,7 +142,7 @@ class PropertyAttributeSourceImpl extends AbstractHbmSourceNode implements Singu
|
|||
|
||||
@Override
|
||||
public boolean isIncludedInOptimisticLocking() {
|
||||
return Helper.getBooleanValue( propertyElement.isOptimisticLock(), true );
|
||||
return Helper.getValue( propertyElement.isOptimisticLock(), true );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -157,17 +157,17 @@ class PropertyAttributeSourceImpl extends AbstractHbmSourceNode implements Singu
|
|||
|
||||
@Override
|
||||
public boolean areValuesIncludedInInsertByDefault() {
|
||||
return Helper.getBooleanValue( propertyElement.isInsert(), true );
|
||||
return Helper.getValue( propertyElement.isInsert(), true );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areValuesIncludedInUpdateByDefault() {
|
||||
return Helper.getBooleanValue( propertyElement.isUpdate(), true );
|
||||
return Helper.getValue( propertyElement.isUpdate(), true );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areValuesNullableByDefault() {
|
||||
return ! Helper.getBooleanValue( propertyElement.isNotNull(), false );
|
||||
return ! Helper.getValue( propertyElement.isNotNull(), false );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -172,7 +172,7 @@ public class RootEntitySourceImpl extends AbstractEntitySourceImpl implements Ro
|
|||
|
||||
@Override
|
||||
public OptimisticLockStyle getOptimisticLockStyle() {
|
||||
final String optimisticLockModeString = Helper.getStringValue( entityElement().getOptimisticLock(), "version" );
|
||||
final String optimisticLockModeString = Helper.getValue( entityElement().getOptimisticLock(), "version" );
|
||||
try {
|
||||
return OptimisticLockStyle.valueOf( optimisticLockModeString.toUpperCase() );
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ class VersionAttributeSourceImpl
|
|||
|
||||
@Override
|
||||
public boolean isIncludedInInsertByDefault() {
|
||||
return Helper.getBooleanValue( versionElement.isInsert(), true );
|
||||
return Helper.getValue( versionElement.isInsert(), true );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -169,7 +169,7 @@ class VersionAttributeSourceImpl
|
|||
|
||||
@Override
|
||||
public boolean areValuesIncludedInInsertByDefault() {
|
||||
return Helper.getBooleanValue( versionElement.isInsert(), true );
|
||||
return Helper.getValue( versionElement.isInsert(), true );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -54,12 +54,12 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
FILTER-PARAM element; qualifies parameters found within a FILTER-DEF
|
||||
condition.
|
||||
-->
|
||||
<xs:element name="filter-param">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/> <!-- The parameter name -->
|
||||
<xs:attribute name="type" use="required" type="xs:string"/> <!-- The parameter type -->
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="filter-param">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/> <!-- The parameter name -->
|
||||
<xs:attribute name="type" use="required" type="xs:string"/> <!-- The parameter type -->
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="condition" type="xs:string"/>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/> <!-- The filter name -->
|
||||
|
@ -106,7 +106,7 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
</xs:sequence>
|
||||
<xs:attribute name="access" type="xs:string"/>
|
||||
<xs:attribute name="column" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:int"/>
|
||||
<xs:attribute name="name" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="type" type="xs:string"/>
|
||||
|
@ -159,7 +159,7 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:attribute name="force" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="formula" type="xs:string"/>
|
||||
<xs:attribute name="insert" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="length" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:int"/>
|
||||
<xs:attribute name="not-null" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="type" default="string" type="xs:string"/>
|
||||
</xs:complexType>
|
||||
|
@ -276,9 +276,9 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="union-subclass" minOccurs="0" maxOccurs="unbounded" type="union-subclass-element"/>
|
||||
</xs:choice>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-element"/>
|
||||
<xs:element name="fetch-profile" minOccurs="0" maxOccurs="unbounded" type="fetch-profile-element"/>
|
||||
<xs:element name="resultset" minOccurs="0" maxOccurs="unbounded" type="resultset-element"/>
|
||||
|
@ -287,15 +287,15 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="sql-query" type="sql-query-element"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="abstract" type="xs:boolean"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="abstract" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="batch-size" default="-1" type="xs:int"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="discriminator-value" type="xs:string"/> <!-- default: unqualified class name | none -->
|
||||
<xs:attribute name="dynamic-insert" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="dynamic-update" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="entity-name" type="xs:string"/>
|
||||
<xs:attribute name="lazy" type="xs:boolean"/>
|
||||
<xs:attribute name="lazy" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="mutable" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="name" type="xs:string"/> <!-- this is the class name -->
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
|
@ -433,15 +433,15 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="many-to-any" type="many-to-any-element"/>
|
||||
</xs:choice>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-delete-all-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-dml-element"/>
|
||||
</xs:sequence>
|
||||
<xs:attributeGroup ref="table-information-group"/>
|
||||
<xs:attribute name="access" type="xs:string"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="batch-size" default="-1" type="xs:int"/>
|
||||
<xs:attribute name="cascade" type="xs:string"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="collection-type" type="xs:string"/>
|
||||
<xs:attribute name="element-class" type="xs:string"/>
|
||||
|
@ -454,9 +454,6 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:attribute name="optimistic-lock" default="true" type="xs:boolean"/> <!-- only supported for properties of a class (not component) -->
|
||||
<xs:attribute name="outer-join" type="outer-join-attribute"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
<xs:attribute name="schema" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
<xs:attribute name="table" type="xs:string"/> <!-- default: name -->
|
||||
<xs:attribute name="where" type="xs:string"/> <!-- default: none -->
|
||||
</xs:complexType>
|
||||
|
||||
|
@ -477,33 +474,20 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="many-to-any" type="many-to-any-element"/>
|
||||
</xs:choice>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-delete-all-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="access" type="xs:string"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="cascade" type="xs:string"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="collection-type" type="xs:string"/>
|
||||
<xs:attributeGroup ref="table-information-group"/>
|
||||
<xs:attributeGroup ref="plural-basic-attribute-group"/>
|
||||
<xs:attribute name="embed-xml" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="fetch" type="fetch-attribute-with-subselect"/>
|
||||
<xs:attribute name="inverse" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="lazy" type="lazy-attribute-with-extra"/>
|
||||
<xs:attribute name="mutable" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="optimistic-lock" default="true" type="xs:boolean"/> <!-- only supported for properties of a class (not component) -->
|
||||
<xs:attribute name="order-by" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="outer-join" type="outer-join-attribute"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
<xs:attribute name="schema" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
<xs:attribute name="table" type="xs:string"/> <!-- default: name -->
|
||||
<xs:attribute name="where" type="xs:string"/> <!-- default: none -->
|
||||
</xs:complexType>
|
||||
|
||||
<!-- The cache element enables caching of an entity class. -->
|
||||
|
@ -542,12 +526,12 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:attribute name="check" type="xs:string"/> <!-- default: no check constraint -->
|
||||
<xs:attribute name="default" type="xs:string"/> <!-- default: no default value -->
|
||||
<xs:attribute name="index" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:string"/> <!-- default: 255 -->
|
||||
<xs:attribute name="length" type="xs:int"/> <!-- default: 255 -->
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="not-null" type="xs:boolean"/> <!-- default: false (except for id properties) -->
|
||||
<xs:attribute name="precision" type="xs:string"/>
|
||||
<xs:attribute name="precision" type="xs:int"/>
|
||||
<xs:attribute name="read" type="xs:string"/> <!-- default: column name -->
|
||||
<xs:attribute name="scale" type="xs:string"/>
|
||||
<xs:attribute name="scale" type="xs:int"/>
|
||||
<xs:attribute name="sql-type" type="xs:string"/> <!-- override default column type for hibernate type -->
|
||||
<xs:attribute name="unique" type="xs:boolean"/> <!-- default: false (except for id properties) -->
|
||||
<xs:attribute name="unique-key" type="xs:string"/> <!-- default: no unique key -->
|
||||
|
@ -653,11 +637,11 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
</xs:sequence>
|
||||
<xs:attribute name="column" type="xs:string"/>
|
||||
<xs:attribute name="formula" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:int"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="not-null" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="precision" type="xs:string"/>
|
||||
<xs:attribute name="scale" type="xs:string"/>
|
||||
<xs:attribute name="precision" type="xs:int"/>
|
||||
<xs:attribute name="scale" type="xs:int"/>
|
||||
<xs:attribute name="type" type="xs:string"/>
|
||||
<xs:attribute name="unique" default="false" type="xs:boolean"/>
|
||||
</xs:complexType>
|
||||
|
@ -728,7 +712,7 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="generator" type="generator-element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="column" use="required" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:int"/>
|
||||
<xs:attribute name="type" use="required" type="xs:string"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
@ -740,32 +724,20 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="many-to-any" type="many-to-any-element"/>
|
||||
</xs:choice>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-delete-all-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="access" type="xs:string"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="cascade" type="xs:string"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="collection-type" type="xs:string"/>
|
||||
<xs:attributeGroup ref="table-information-group"/>
|
||||
<xs:attributeGroup ref="plural-basic-attribute-group"/>
|
||||
<xs:attribute name="embed-xml" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="fetch" type="fetch-attribute-with-subselect"/>
|
||||
<xs:attribute name="lazy" type="lazy-attribute-with-extra"/>
|
||||
<xs:attribute name="mutable" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="optimistic-lock" default="true" type="xs:boolean"/> <!-- only supported for properties of a class (not component) -->
|
||||
<xs:attribute name="order-by" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="outer-join" type="outer-join-attribute"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
<xs:attribute name="schema" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
<xs:attribute name="table" type="xs:string"/> <!-- default: name -->
|
||||
<xs:attribute name="where" type="xs:string"/> <!-- default: none -->
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="index-element">
|
||||
|
@ -773,7 +745,7 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="column" minOccurs="0" maxOccurs="unbounded" type="column-element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="column" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:int"/>
|
||||
<xs:attribute name="type" type="xs:string"/> <!-- required for maps -->
|
||||
</xs:complexType>
|
||||
|
||||
|
@ -791,17 +763,14 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="dynamic-component" type="dynamic-component-element"/>
|
||||
<xs:element name="any" type="any-element"/>
|
||||
</xs:choice>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="catalog" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attributeGroup ref="table-information-group"/>
|
||||
<xs:attribute name="fetch" default="join" type="fetch-attribute"/>
|
||||
<xs:attribute name="inverse" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="optional" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="schema" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
<xs:attribute name="table" use="required" type="xs:string"/>
|
||||
</xs:complexType>
|
||||
|
||||
<!--
|
||||
|
@ -835,9 +804,9 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
</xs:choice>
|
||||
<xs:element name="joined-subclass" minOccurs="0" maxOccurs="unbounded" type="joined-subclass-element"/>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="fetch-profile" minOccurs="0" maxOccurs="unbounded" type="fetch-profile-element"/>
|
||||
<xs:element name="resultset" minOccurs="0" maxOccurs="unbounded" type="resultset-element"/>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
|
@ -845,23 +814,20 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="sql-query" type="sql-query-element"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="abstract" type="xs:boolean"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/>
|
||||
<xs:attributeGroup ref="table-information-group"/>
|
||||
<xs:attribute name="abstract" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="batch-size" default="-1" type="xs:int"/>
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="dynamic-insert" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="dynamic-update" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="entity-name" type="xs:string"/>
|
||||
<xs:attribute name="extends" type="xs:string"/> <!-- default: none when toplevel, otherwise the nearest class definition -->
|
||||
<xs:attribute name="lazy" type="xs:boolean"/>
|
||||
<xs:attribute name="lazy" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="name" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
<xs:attribute name="proxy" type="xs:string"/> <!-- default: no proxy interface -->
|
||||
<xs:attribute name="schema" type="xs:string"/>
|
||||
<xs:attribute name="select-before-update" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
<xs:attribute name="table" type="xs:string"/> <!-- default: unqualified class name -->
|
||||
</xs:complexType>
|
||||
|
||||
<!-- Declares the column name of a foreign key. -->
|
||||
|
@ -910,7 +876,7 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
</xs:sequence>
|
||||
<xs:attribute name="access" type="xs:string"/>
|
||||
<xs:attribute name="column" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:int"/>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="type" type="xs:string"/>
|
||||
|
@ -937,32 +903,19 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="many-to-any" type="many-to-any-element"/>
|
||||
</xs:choice>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-delete-all-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="access" type="xs:string"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="cascade" type="xs:string"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="collection-type" type="xs:string"/>
|
||||
<xs:attributeGroup ref="table-information-group"/>
|
||||
<xs:attributeGroup ref="plural-basic-attribute-group"/>
|
||||
<xs:attribute name="embed-xml" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="fetch" type="fetch-attribute-with-subselect"/>
|
||||
<xs:attribute name="inverse" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="lazy" type="lazy-attribute-with-extra"/>
|
||||
<xs:attribute name="mutable" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="optimistic-lock" default="true" type="xs:boolean"/> <!-- only supported for properties of a class (not component) -->
|
||||
<xs:attribute name="outer-join" type="outer-join-attribute"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
<xs:attribute name="schema" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
<xs:attribute name="table" type="xs:string"/> <!-- default: name -->
|
||||
<xs:attribute name="where" type="xs:string"/> <!-- default: none -->
|
||||
</xs:complexType>
|
||||
|
||||
<!-- Declares the type and column mapping for a collection index (array or
|
||||
|
@ -1093,7 +1046,7 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
</xs:sequence>
|
||||
<xs:attribute name="column" type="xs:string"/>
|
||||
<xs:attribute name="formula" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:int"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="type" type="xs:string"/>
|
||||
</xs:complexType>
|
||||
|
@ -1170,34 +1123,21 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="many-to-any" type="many-to-any-element"/>
|
||||
</xs:choice>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-delete-all-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="access" type="xs:string"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="cascade" type="xs:string"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="collection-type" type="xs:string"/>
|
||||
<xs:attributeGroup ref="table-information-group"/>
|
||||
<xs:attributeGroup ref="plural-basic-attribute-group"/>
|
||||
<xs:attribute name="embed-xml" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="fetch" type="fetch-attribute-with-subselect"/>
|
||||
<xs:attribute name="inverse" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="lazy" type="lazy-attribute-with-extra"/>
|
||||
<xs:attribute name="mutable" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="optimistic-lock" default="true" type="xs:boolean"/> <!-- only supported for properties of a class (not component) -->
|
||||
<xs:attribute name="order-by" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="outer-join" type="outer-join-attribute"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
<xs:attribute name="schema" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="sort" default="unsorted" type="xs:string"/> <!-- unsorted|natural|"comparator class", default: unsorted -->
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
<xs:attribute name="table" type="xs:string"/> <!-- default: name -->
|
||||
<xs:attribute name="where" type="xs:string"/> <!-- default: none -->
|
||||
</xs:complexType>
|
||||
|
||||
<!--
|
||||
|
@ -1300,14 +1240,14 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
</xs:choice>
|
||||
<xs:element name="element" type="element-element"/>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-delete-all-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-dml-element"/>
|
||||
</xs:sequence>
|
||||
<xs:attributeGroup ref="table-information-group"/>
|
||||
<xs:attribute name="access" type="xs:string"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="batch-size" default="-1" type="xs:int"/>
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="collection-type" type="xs:string"/>
|
||||
<xs:attribute name="embed-xml" default="true" type="xs:boolean"/>
|
||||
|
@ -1318,9 +1258,6 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:attribute name="optimistic-lock" default="true" type="xs:boolean"/> <!-- only supported for properties of a class (not component) -->
|
||||
<xs:attribute name="outer-join" type="outer-join-attribute"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
<xs:attribute name="schema" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
<xs:attribute name="table" type="xs:string"/> <!-- default: name -->
|
||||
<xs:attribute name="where" type="xs:string"/> <!-- default: none -->
|
||||
</xs:complexType>
|
||||
|
||||
|
@ -1371,7 +1308,7 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:attribute name="index" type="xs:string"/> <!-- include the columns spanned by this property in an index -->
|
||||
<xs:attribute name="insert" type="xs:boolean"/>
|
||||
<xs:attribute name="lazy" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="length" type="xs:string"/>
|
||||
<xs:attribute name="length" type="xs:int"/>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="not-null" type="xs:boolean"/>
|
||||
|
@ -1393,11 +1330,11 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:attribute name="cache-region" type="xs:string"/>
|
||||
<xs:attribute name="cacheable" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="comment" type="xs:string"/>
|
||||
<xs:attribute name="fetch-size" type="xs:string"/>
|
||||
<xs:attribute name="fetch-size" type="xs:int"/>
|
||||
<xs:attribute name="flush-mode" type="flush-mode-attribute"/>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="read-only" type="xs:boolean"/>
|
||||
<xs:attribute name="timeout" type="xs:string"/>
|
||||
<xs:attribute name="timeout" type="xs:int"/>
|
||||
</xs:complexType>
|
||||
|
||||
<!-- The query-param element is used only by tools that generate
|
||||
|
@ -1468,6 +1405,20 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:attribute name="type" type="xs:string"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:attributeGroup name="plural-basic-attribute-group">
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="access" type="xs:string"/>
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="where" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="cascade" type="xs:string"/>
|
||||
<xs:attribute name="batch-size" default="-1" type="xs:int"/>
|
||||
<xs:attribute name="inverse" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="mutable" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="optimistic-lock" default="true" type="xs:boolean"/> <!-- only supported for properties of a class (not component) -->
|
||||
<xs:attribute name="collection-type" type="xs:string"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
</xs:attributeGroup>
|
||||
|
||||
<xs:complexType name="set-element">
|
||||
<xs:sequence>
|
||||
<xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="meta-element"/>
|
||||
|
@ -1485,56 +1436,24 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="many-to-any" type="many-to-any-element"/>
|
||||
</xs:choice>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-delete-all-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete-all" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-element"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="access" type="xs:string"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="cascade" type="xs:string"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="collection-type" type="xs:string"/>
|
||||
<xs:attributeGroup ref="table-information-group"/>
|
||||
<xs:attributeGroup ref="plural-basic-attribute-group"/>
|
||||
<xs:attribute name="embed-xml" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="fetch" type="fetch-attribute-with-subselect"/>
|
||||
<xs:attribute name="inverse" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="lazy" type="lazy-attribute-with-extra"/>
|
||||
<xs:attribute name="mutable" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="optimistic-lock" default="true" type="xs:boolean"/> <!-- only supported for properties of a class (not component) -->
|
||||
<xs:attribute name="order-by" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="outer-join" type="outer-join-attribute"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
<xs:attribute name="schema" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="sort" default="unsorted" type="xs:string"/> <!-- unsorted|natural|"comparator class" -->
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
<xs:attribute name="table" type="xs:string"/> <!-- default: name -->
|
||||
<xs:attribute name="where" type="xs:string"/> <!-- default: none -->
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="sql-delete-all-element" mixed="true">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="callable" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="check" type="check-attribute"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="sql-delete-element" mixed="true">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="callable" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="check" type="check-attribute"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
|
||||
<!-- custom sql operations -->
|
||||
<xs:complexType name="sql-insert-element" mixed="true">
|
||||
<xs:complexType name="sql-dml-element" mixed="true">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="callable" default="false" type="xs:boolean"/>
|
||||
|
@ -1558,21 +1477,12 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:attribute name="cacheable" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="callable" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="comment" type="xs:string"/>
|
||||
<xs:attribute name="fetch-size" type="xs:string"/>
|
||||
<xs:attribute name="fetch-size" type="xs:int"/>
|
||||
<xs:attribute name="flush-mode" type="flush-mode-attribute"/>
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="read-only" type="xs:boolean"/>
|
||||
<xs:attribute name="resultset-ref" type="xs:string"/>
|
||||
<xs:attribute name="timeout" type="xs:string"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:complexType name="sql-update-element" mixed="true">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="callable" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="check" type="check-attribute"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
<xs:attribute name="timeout" type="xs:int"/>
|
||||
</xs:complexType>
|
||||
|
||||
<!--
|
||||
|
@ -1603,9 +1513,9 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="join" minOccurs="0" maxOccurs="unbounded" type="join-element"/>
|
||||
<xs:element name="subclass" minOccurs="0" maxOccurs="unbounded" type="subclass-element"/>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="fetch-profile" minOccurs="0" maxOccurs="unbounded" type="fetch-profile-element"/>
|
||||
<xs:element name="resultset" minOccurs="0" maxOccurs="unbounded" type="resultset-element"/>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
|
@ -1613,14 +1523,14 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="sql-query" type="sql-query-element"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="abstract" type="xs:boolean"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="abstract" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="batch-size" default="-1" type="xs:int"/>
|
||||
<xs:attribute name="discriminator-value" type="xs:string"/> <!-- default: unqualified class name | none -->
|
||||
<xs:attribute name="dynamic-insert" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="dynamic-update" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="entity-name" type="xs:string"/>
|
||||
<xs:attribute name="extends" type="xs:string"/> <!-- default: empty when a toplevel, otherwise the nearest class definition -->
|
||||
<xs:attribute name="lazy" type="xs:boolean"/>
|
||||
<xs:attribute name="lazy" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="name" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
|
@ -1657,6 +1567,13 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
</xs:complexType>
|
||||
|
||||
<xs:attributeGroup name="table-information-group">
|
||||
<xs:attribute name="schema" type="xs:string"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/>
|
||||
<xs:attribute name="table" type="xs:string"/>
|
||||
<!-- default: unqualified class name -->
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
</xs:attributeGroup>
|
||||
<!--
|
||||
Union subclasses are used for the table-per-concrete-class mapping strategy
|
||||
See the note on the class element regarding <pojo/> vs. @name usage...
|
||||
|
@ -1687,9 +1604,9 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
</xs:choice>
|
||||
<xs:element name="union-subclass" minOccurs="0" maxOccurs="unbounded" type="union-subclass-element"/>
|
||||
<xs:element name="loader" minOccurs="0" type="loader-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-insert-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-update-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-delete-element"/>
|
||||
<xs:element name="sql-insert" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-update" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="sql-delete" minOccurs="0" type="sql-dml-element"/>
|
||||
<xs:element name="fetch-profile" minOccurs="0" maxOccurs="unbounded" type="fetch-profile-element"/>
|
||||
<xs:element name="resultset" minOccurs="0" maxOccurs="unbounded" type="resultset-element"/>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
|
@ -1697,23 +1614,20 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:element name="sql-query" type="sql-query-element"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="abstract" type="xs:boolean"/>
|
||||
<xs:attribute name="batch-size" type="xs:string"/>
|
||||
<xs:attribute name="catalog" type="xs:string"/>
|
||||
<xs:attributeGroup ref="table-information-group"/>
|
||||
<xs:attribute name="abstract" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="batch-size" default="-1" type="xs:int"/>
|
||||
<xs:attribute name="check" type="xs:string"/> <!-- default: none -->
|
||||
<xs:attribute name="dynamic-insert" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="dynamic-update" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="entity-name" type="xs:string"/>
|
||||
<xs:attribute name="extends" type="xs:string"/> <!-- default: none when toplevel, otherwise the nearest class definition -->
|
||||
<xs:attribute name="lazy" type="xs:boolean"/>
|
||||
<xs:attribute name="lazy" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="name" type="xs:string"/>
|
||||
<xs:attribute name="node" type="xs:string"/>
|
||||
<xs:attribute name="persister" type="xs:string"/>
|
||||
<xs:attribute name="proxy" type="xs:string"/> <!-- default: no proxy interface -->
|
||||
<xs:attribute name="schema" type="xs:string"/>
|
||||
<xs:attribute name="select-before-update" default="false" type="xs:boolean"/>
|
||||
<xs:attribute name="subselect" type="xs:string"/>
|
||||
<xs:attribute name="table" type="xs:string"/> <!-- default: unqualified class name -->
|
||||
</xs:complexType>
|
||||
|
||||
<xs:simpleType name="cache-mode-attribute">
|
||||
|
@ -1794,6 +1708,12 @@ arbitrary number of queries, and import declarations of arbitrary classes.
|
|||
<xs:enumeration value="upgrade"/>
|
||||
<xs:enumeration value="upgrade-nowait"/>
|
||||
<xs:enumeration value="write"/>
|
||||
<xs:enumeration value="force"/>
|
||||
<xs:enumeration value="optimistic"/>
|
||||
<xs:enumeration value="optimistic_force_increment"/>
|
||||
<xs:enumeration value="pessimistic_read"/>
|
||||
<xs:enumeration value="pessimistic_write"/>
|
||||
<xs:enumeration value="pessimistic_force_increment"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
|
|
|
@ -38,20 +38,6 @@
|
|||
<jaxb:bindings node="//xsd:complexType[@name='join-element']">
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.TableInformationSource</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
|
||||
<jaxb:bindings node="//xsd:complexType[@name='sql-insert-element']">
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='sql-update-element']">
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='sql-delete-element']">
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='sql-delete-all-element']">
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.CustomSqlElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
|
||||
<jaxb:bindings node="//xsd:complexType[@name='property-element']">
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.SingularAttributeSource</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
|
@ -76,7 +62,6 @@
|
|||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement</inheritance:implements>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='idbag-element']">
|
||||
<inheritance:implements>org.hibernate.internal.jaxb.mapping.hbm.PluralAttributeElement</inheritance:implements>
|
||||
<inheritance:extends>org.hibernate.internal.jaxb.mapping.hbm.IdBagPluralAttributeElementAdapter</inheritance:extends>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='list-element']">
|
||||
|
@ -108,30 +93,15 @@
|
|||
<jaxb:bindings node="//xsd:element[@name='version']//xsd:attribute[@name='column']">
|
||||
<jaxb:property name="columnAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='array-element']//xsd:attribute[@name='subselect']">
|
||||
<jaxb:property name="subselectAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='bag-element']//xsd:attribute[@name='subselect']">
|
||||
<jaxb:property name="subselectAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='element-element']//xsd:attribute[@name='type']">
|
||||
<jaxb:property name="typeAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='idbag-element']//xsd:attribute[@name='subselect']">
|
||||
<jaxb:property name="subselectAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='idbag-element']//xsd:element[@name='collection-id']//xsd:attribute[@name='column']">
|
||||
<jaxb:property name="columnAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='index-element']//xsd:attribute[@name='column']">
|
||||
<jaxb:property name="columnAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='join-element']//xsd:attribute[@name='subselect']">
|
||||
<jaxb:property name="subselectAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='joined-subclass-element']//xsd:attribute[@name='subselect']">
|
||||
<jaxb:property name="subselectAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='key-element']//xsd:attribute[@name='column']">
|
||||
<jaxb:property name="columnAttribute"/>
|
||||
</jaxb:bindings>
|
||||
|
@ -144,15 +114,9 @@
|
|||
<jaxb:bindings node="//xsd:complexType[@name='key-property-element']//xsd:attribute[@name='type']">
|
||||
<jaxb:property name="typeAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='list-element']//xsd:attribute[@name='subselect']">
|
||||
<jaxb:property name="subselectAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='list-index-element']//xsd:attribute[@name='column']">
|
||||
<jaxb:property name="columnAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='map-element']//xsd:attribute[@name='subselect']">
|
||||
<jaxb:property name="subselectAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='map-element']//xsd:element[@name='map-key']//xsd:attribute[@name='type']">
|
||||
<jaxb:property name="typeAttribute"/>
|
||||
</jaxb:bindings>
|
||||
|
@ -162,16 +126,12 @@
|
|||
<jaxb:bindings node="//xsd:complexType[@name='one-to-one-element']//xsd:attribute[@name='formula']">
|
||||
<jaxb:property name="formulaAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='primitive-array-element']//xsd:attribute[@name='subselect']">
|
||||
<jaxb:property name="subselectAttribute"/>
|
||||
</jaxb:bindings>
|
||||
|
||||
<jaxb:bindings node="//xsd:complexType[@name='property-element']//xsd:attribute[@name='type']">
|
||||
<jaxb:property name="typeAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='set-element']//xsd:attribute[@name='subselect']">
|
||||
<jaxb:property name="subselectAttribute"/>
|
||||
</jaxb:bindings>
|
||||
<jaxb:bindings node="//xsd:complexType[@name='union-subclass-element']//xsd:attribute[@name='subselect']">
|
||||
|
||||
<jaxb:bindings node="//xsd:attributeGroup[@name='table-information-group']//xsd:attribute[@name='subselect']">
|
||||
<jaxb:property name="subselectAttribute"/>
|
||||
</jaxb:bindings>
|
||||
|
||||
|
@ -181,7 +141,6 @@
|
|||
<jaxb:bindings node="//xsd:element[@name='multi-tenancy']//xsd:attribute[@name='formula']">
|
||||
<jaxb:property name="formulaAttribute"/>
|
||||
</jaxb:bindings>
|
||||
|
||||
</jaxb:bindings>
|
||||
|
||||
</jaxb:bindings>
|
Loading…
Reference in New Issue