diff --git a/hibernate-core/src/main/java/org/hibernate/engine/config/spi/ConfigurationService.java b/hibernate-core/src/main/java/org/hibernate/engine/config/spi/ConfigurationService.java index c988fb3dd7..238c4e0364 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/config/spi/ConfigurationService.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/config/spi/ConfigurationService.java @@ -33,7 +33,7 @@ import org.hibernate.service.Service; * @author Steve Ebersole */ public interface ConfigurationService extends Service { - public Map getSettings(); + public Map getSettings(); public T getSetting(String name); public T getSetting(String name, Converter converter); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/Binder.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/Binder.java index eea99beb89..660028f8c5 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/Binder.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/Binder.java @@ -115,6 +115,7 @@ import org.hibernate.metamodel.spi.source.AggregatedCompositeIdentifierSource; import org.hibernate.metamodel.spi.source.AttributeSource; import org.hibernate.metamodel.spi.source.AttributeSourceContainer; import org.hibernate.metamodel.spi.source.BasicPluralAttributeElementSource; +import org.hibernate.metamodel.spi.source.BasicPluralAttributeIndexSource; import org.hibernate.metamodel.spi.source.ColumnSource; import org.hibernate.metamodel.spi.source.ComponentAttributeSource; import org.hibernate.metamodel.spi.source.CompositePluralAttributeElementSource; @@ -130,6 +131,7 @@ import org.hibernate.metamodel.spi.source.ForeignKeyContributingSource.JoinColum import org.hibernate.metamodel.spi.source.IdentifierSource; import org.hibernate.metamodel.spi.source.InLineViewSource; import org.hibernate.metamodel.spi.source.IndexedPluralAttributeSource; +import org.hibernate.metamodel.spi.source.PluralAttributeIndexSource; import org.hibernate.metamodel.spi.source.LocalBindingContext; import org.hibernate.metamodel.spi.source.ManyToManyPluralAttributeElementSource; import org.hibernate.metamodel.spi.source.MappingDefaults; @@ -140,7 +142,6 @@ import org.hibernate.metamodel.spi.source.NonAggregatedCompositeIdentifierSource import org.hibernate.metamodel.spi.source.OneToManyPluralAttributeElementSource; import org.hibernate.metamodel.spi.source.Orderable; import org.hibernate.metamodel.spi.source.PluralAttributeElementSource; -import org.hibernate.metamodel.spi.source.PluralAttributeIndexSource; import org.hibernate.metamodel.spi.source.PluralAttributeKeySource; import org.hibernate.metamodel.spi.source.PluralAttributeSource; import org.hibernate.metamodel.spi.source.PrimaryKeyJoinColumnSource; @@ -148,6 +149,7 @@ import org.hibernate.metamodel.spi.source.RelationalValueSource; import org.hibernate.metamodel.spi.source.RelationalValueSourceContainer; import org.hibernate.metamodel.spi.source.RootEntitySource; import org.hibernate.metamodel.spi.source.SecondaryTableSource; +import org.hibernate.metamodel.spi.source.SequentialPluralAttributeIndexSource; import org.hibernate.metamodel.spi.source.SimpleIdentifierSource; import org.hibernate.metamodel.spi.source.SingularAttributeSource; import org.hibernate.metamodel.spi.source.Sortable; @@ -1339,7 +1341,7 @@ public class Binder { case LIST: attributeBinding = bindListAttribute( attributeBindingContainer, - attributeSource, + (IndexedPluralAttributeSource) attributeSource, attribute ); break; @@ -1353,7 +1355,7 @@ public class Binder { case ARRAY: attributeBinding = bindArrayAttribute( attributeBindingContainer, - attributeSource, + (IndexedPluralAttributeSource) attributeSource, attribute ); break; @@ -1427,7 +1429,13 @@ public class Binder { ) ); } - bindIndexedPluralAttributeIfPossible( attributeSource, attributeBinding, reflectedCollectionJavaTypes ); + if ( attributeBinding.hasIndex() ) { + bindPluralAttributeIndex( + (IndexedPluralAttributeSource) attributeSource, + (IndexedPluralAttributeBinding) attributeBinding, + reflectedCollectionJavaTypes + ); + } bindCollectionTablePrimaryKey( attributeBinding, attributeSource ); metadata.addCollection( attributeBinding ); return attributeBinding; @@ -1452,15 +1460,11 @@ public class Binder { private AbstractPluralAttributeBinding bindListAttribute( final AttributeBindingContainer attributeBindingContainer, - final PluralAttributeSource attributeSource, + final IndexedPluralAttributeSource attributeSource, PluralAttribute attribute) { if ( attribute == null ) { attribute = attributeBindingContainer.getAttributeContainer().createList( attributeSource.getName() ); } - final int base = IndexedPluralAttributeSource.class.isInstance( attributeSource ) ? IndexedPluralAttributeSource.class - .cast( attributeSource ) - .getIndexSource() - .base() : 0; return attributeBindingContainer.makeListAttributeBinding( attribute, pluralAttributeElementNature( attributeSource ), @@ -1468,21 +1472,17 @@ public class Binder { propertyAccessorName( attributeSource ), attributeSource.isIncludedInOptimisticLocking(), createMetaAttributeContext( attributeBindingContainer, attributeSource ), - base + getSequentialPluralAttributeIndexBase( attributeSource ) ); } private AbstractPluralAttributeBinding bindArrayAttribute( final AttributeBindingContainer attributeBindingContainer, - final PluralAttributeSource attributeSource, + final IndexedPluralAttributeSource attributeSource, PluralAttribute attribute) { if ( attribute == null ) { attribute = attributeBindingContainer.getAttributeContainer().createArray( attributeSource.getName() ); } - final int base = IndexedPluralAttributeSource.class.isInstance( attributeSource ) ? IndexedPluralAttributeSource.class - .cast( attributeSource ) - .getIndexSource() - .base() : 0; return attributeBindingContainer.makeArrayAttributeBinding( attribute, pluralAttributeElementNature( attributeSource ), @@ -1490,10 +1490,24 @@ public class Binder { propertyAccessorName( attributeSource ), attributeSource.isIncludedInOptimisticLocking(), createMetaAttributeContext( attributeBindingContainer, attributeSource ), - base + getSequentialPluralAttributeIndexBase( attributeSource ) ); } + private int getSequentialPluralAttributeIndexBase(IndexedPluralAttributeSource pluralAttributeSource) { + final PluralAttributeIndexSource indexedPluralAttributeSource = pluralAttributeSource.getIndexSource(); + if ( ! SequentialPluralAttributeIndexSource.class.isInstance( indexedPluralAttributeSource ) ) { + throw new IllegalArgumentException( + String.format( + "Expected an argument of type: %s; instead, got %s", + SequentialPluralAttributeIndexSource.class.getName(), + indexedPluralAttributeSource.getClass().getName() + ) + ); + } + return ( (SequentialPluralAttributeIndexSource) indexedPluralAttributeSource ).base(); + } + private AbstractPluralAttributeBinding bindMapAttribute( final AttributeBindingContainer attributeBindingContainer, final PluralAttributeSource attributeSource, @@ -1647,19 +1661,18 @@ public class Binder { } } - private void bindCollectionIndex( + private void bindBasicCollectionIndex( final IndexedPluralAttributeBinding attributeBinding, - final PluralAttributeIndexSource attributeSource, + final BasicPluralAttributeIndexSource attributeSource, final String defaultIndexJavaTypeName) { - IndexedPluralAttributeBinding indexedAttributeBinding = attributeBinding; final BasicPluralAttributeIndexBinding indexBinding = - (BasicPluralAttributeIndexBinding) indexedAttributeBinding.getPluralAttributeIndexBinding(); + (BasicPluralAttributeIndexBinding) attributeBinding.getPluralAttributeIndexBinding(); indexBinding.setIndexRelationalValue( bindValues( - indexedAttributeBinding.getContainer(), + attributeBinding.getContainer(), attributeSource, - indexedAttributeBinding.getAttribute(), - indexedAttributeBinding.getPluralAttributeKeyBinding().getCollectionTable(), + attributeBinding.getAttribute(), + attributeBinding.getPluralAttributeKeyBinding().getCollectionTable(), attributeBinding.getPluralAttributeElementBinding() .getNature() != PluralAttributeElementBinding.Nature.ONE_TO_MANY ) @@ -1859,23 +1872,27 @@ public class Binder { bindCollectionTableForeignKey( attributeBinding, attributeSource.getKeySource(), collectionTable ); } - - private void bindIndexedPluralAttributeIfPossible( - final PluralAttributeSource attributeSource, - final AbstractPluralAttributeBinding attributeBinding, + private void bindPluralAttributeIndex( + final IndexedPluralAttributeSource attributeSource, + final IndexedPluralAttributeBinding attributeBinding, final ReflectedCollectionJavaTypes reflectedCollectionJavaTypes) { - if ( attributeBinding.getAttribute() - .getNature() - .isIndexable() && attributeSource instanceof IndexedPluralAttributeSource ) { - attributeBinding.setIndex( true ); - bindCollectionIndex( - (IndexedPluralAttributeBinding) attributeBinding, - ( (IndexedPluralAttributeSource) attributeSource ).getIndexSource(), - HibernateTypeHelper.defaultCollectionIndexJavaTypeName( reflectedCollectionJavaTypes ) - ); - } - else { - attributeBinding.setIndex( false ); + switch ( attributeSource.getIndexSource().getNature() ) { + case BASIC: { + bindBasicCollectionIndex( + attributeBinding, + (BasicPluralAttributeIndexSource) attributeSource.getIndexSource(), + HibernateTypeHelper.defaultCollectionIndexJavaTypeName( reflectedCollectionJavaTypes ) + ); + break; + } + default: { + throw new NotYetImplementedException( + String.format( + "%s collection indexes are not supported yet.", + attributeSource.getIndexSource().getNature() + ) + ); + } } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeIndexSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/BasicPluralAttributeIndexSourceImpl.java similarity index 62% rename from hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeIndexSourceImpl.java rename to hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/BasicPluralAttributeIndexSourceImpl.java index 8e7cc3ea9b..612875f666 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeIndexSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/BasicPluralAttributeIndexSourceImpl.java @@ -1,3 +1,26 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2012, 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.metamodel.internal.source.annotations; import java.util.ArrayList; @@ -12,19 +35,18 @@ import org.hibernate.metamodel.internal.source.annotations.util.HibernateDotName import org.hibernate.metamodel.internal.source.annotations.util.JPADotNames; import org.hibernate.metamodel.internal.source.annotations.util.JandexHelper; import org.hibernate.metamodel.spi.binding.PluralAttributeIndexBinding; +import org.hibernate.metamodel.spi.source.BasicPluralAttributeIndexSource; import org.hibernate.metamodel.spi.source.ExplicitHibernateTypeSource; -import org.hibernate.metamodel.spi.source.PluralAttributeIndexSource; import org.hibernate.metamodel.spi.source.RelationalValueSource; /** * @author Strong Liu */ -public class PluralAttributeIndexSourceImpl implements PluralAttributeIndexSource { +public class BasicPluralAttributeIndexSourceImpl implements BasicPluralAttributeIndexSource { private final PluralAssociationAttribute attribute; private final IndexedPluralAttributeSourceImpl indexedPluralAttributeSource; - private final int base; private final List relationalValueSources = new ArrayList( 1 ); - public PluralAttributeIndexSourceImpl(IndexedPluralAttributeSourceImpl indexedPluralAttributeSource, PluralAssociationAttribute attribute) { + public BasicPluralAttributeIndexSourceImpl(IndexedPluralAttributeSourceImpl indexedPluralAttributeSource, PluralAssociationAttribute attribute) { this.attribute = attribute; this.indexedPluralAttributeSource = indexedPluralAttributeSource; AnnotationInstance columnAnnotation = JandexHelper.getSingleAnnotation( @@ -37,8 +59,6 @@ public class PluralAttributeIndexSourceImpl implements PluralAttributeIndexSourc JPADotNames.ORDER_COLUMN ); } - this.base = columnAnnotation.value( "base" ) != null ? columnAnnotation.value( "base" ) - .asInt() : 0; Column indexColumn = new Column( columnAnnotation ); relationalValueSources.add( new ColumnValuesSourceImpl( indexColumn ) ); @@ -46,22 +66,7 @@ public class PluralAttributeIndexSourceImpl implements PluralAttributeIndexSourc @Override public PluralAttributeIndexBinding.Nature getNature() { - switch ( indexedPluralAttributeSource.getElementSource().getNature() ) { - case BASIC: - return PluralAttributeIndexBinding.Nature.BASIC; - case AGGREGATE: - return PluralAttributeIndexBinding.Nature.AGGREGATE; - case MANY_TO_ANY: - return PluralAttributeIndexBinding.Nature.MANY_TO_ANY; - case MANY_TO_MANY: - return PluralAttributeIndexBinding.Nature.MANY_TO_MANY; - } - return null; - } - - @Override - public int base() { - return base; + return PluralAttributeIndexBinding.Nature.BASIC; } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/IndexedPluralAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/IndexedPluralAttributeSourceImpl.java index d8ab0a9709..7355a16fa6 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/IndexedPluralAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/IndexedPluralAttributeSourceImpl.java @@ -1,3 +1,26 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2012, 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.metamodel.internal.source.annotations; import java.util.EnumSet; @@ -5,7 +28,6 @@ import java.util.EnumSet; import org.hibernate.metamodel.internal.source.annotations.attribute.MappedAttribute; import org.hibernate.metamodel.internal.source.annotations.attribute.PluralAssociationAttribute; import org.hibernate.metamodel.internal.source.annotations.entity.ConfiguredClass; -import org.hibernate.metamodel.internal.source.annotations.entity.EntityClass; import org.hibernate.metamodel.spi.source.IndexedPluralAttributeSource; import org.hibernate.metamodel.spi.source.MappingException; import org.hibernate.metamodel.spi.source.PluralAttributeIndexSource; @@ -31,7 +53,13 @@ public class IndexedPluralAttributeSourceImpl extends PluralAttributeSourceImpl attribute.getContext().getOrigin() ); } - this.indexSource = new PluralAttributeIndexSourceImpl( this, attribute ); + if ( attribute.isSequentiallyIndexed() ) { + indexSource = new SequentialPluralAttributeIndexSourceImpl( this, attribute ); + } + else { + // for now assume the index is basic type + indexSource = new BasicPluralAttributeIndexSourceImpl( this, attribute ); + } } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeSourceImpl.java index 240af34546..044fe4b621 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/PluralAttributeSourceImpl.java @@ -35,7 +35,6 @@ import org.hibernate.internal.util.StringHelper; import org.hibernate.internal.util.ValueHolder; import org.hibernate.metamodel.internal.source.annotations.attribute.PluralAssociationAttribute; import org.hibernate.metamodel.internal.source.annotations.entity.ConfiguredClass; -import org.hibernate.metamodel.internal.source.annotations.entity.EntityClass; import org.hibernate.metamodel.internal.source.annotations.util.HibernateDotNames; import org.hibernate.metamodel.internal.source.annotations.util.JandexHelper; import org.hibernate.metamodel.spi.binding.Caching; diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/SequentialPluralAttributeIndexSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/SequentialPluralAttributeIndexSourceImpl.java new file mode 100644 index 0000000000..32a70af8b5 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/SequentialPluralAttributeIndexSourceImpl.java @@ -0,0 +1,61 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2013, 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.metamodel.internal.source.annotations; + +import org.jboss.jandex.AnnotationInstance; + +import org.hibernate.metamodel.internal.source.annotations.attribute.PluralAssociationAttribute; +import org.hibernate.metamodel.internal.source.annotations.util.HibernateDotNames; +import org.hibernate.metamodel.internal.source.annotations.util.JPADotNames; +import org.hibernate.metamodel.internal.source.annotations.util.JandexHelper; +import org.hibernate.metamodel.spi.source.SequentialPluralAttributeIndexSource; + +/** + * @author Gail Badner + */ +public class SequentialPluralAttributeIndexSourceImpl + extends BasicPluralAttributeIndexSourceImpl + implements SequentialPluralAttributeIndexSource { + private final int base; + public SequentialPluralAttributeIndexSourceImpl(IndexedPluralAttributeSourceImpl indexedPluralAttributeSource, PluralAssociationAttribute attribute) { + super( indexedPluralAttributeSource, attribute ); + AnnotationInstance columnAnnotation = JandexHelper.getSingleAnnotation( + attribute.annotations(), + HibernateDotNames.INDEX_COLUMN + ); + if(columnAnnotation == null){ + columnAnnotation = JandexHelper.getSingleAnnotation( + attribute.annotations(), + JPADotNames.ORDER_COLUMN + ); + } + this.base = columnAnnotation.value( "base" ) != null ? columnAnnotation.value( "base" ) + .asInt() : 0; + } + + @Override + public int base() { + return base; + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/SourceHelper.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/SourceHelper.java index b4b63c6325..107c90ec60 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/SourceHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/SourceHelper.java @@ -25,11 +25,13 @@ package org.hibernate.metamodel.internal.source.annotations; import java.util.List; +import org.hibernate.AssertionFailure; import org.hibernate.cfg.NotYetImplementedException; import org.hibernate.metamodel.internal.source.annotations.attribute.AssociationAttribute; import org.hibernate.metamodel.internal.source.annotations.attribute.PluralAssociationAttribute; import org.hibernate.metamodel.internal.source.annotations.entity.ConfiguredClass; import org.hibernate.metamodel.spi.source.AttributeSource; +import org.hibernate.metamodel.spi.source.PluralAttributeSource; /** * @author Strong Liu @@ -53,11 +55,12 @@ public class SourceHelper { case ONE_TO_MANY: case ELEMENT_COLLECTION_BASIC: case ELEMENT_COLLECTION_EMBEDDABLE: { - PluralAssociationAttribute pluralAssociationAttribute = (PluralAssociationAttribute) associationAttribute; - AttributeSource source = pluralAssociationAttribute.isIndexed() ? - new IndexedPluralAttributeSourceImpl( pluralAssociationAttribute, configuredClass ) - : new PluralAttributeSourceImpl( pluralAssociationAttribute, configuredClass ); - attributeList.add( source ); + attributeList.add( + createPluralAttributeSource( + configuredClass, + (PluralAssociationAttribute) associationAttribute + ) + ); break; } default: { @@ -66,4 +69,37 @@ public class SourceHelper { } } } + + private static PluralAttributeSource createPluralAttributeSource( + ConfiguredClass configuredClass, + PluralAssociationAttribute pluralAssociationAttribute) { + switch ( pluralAssociationAttribute.getPluralAttributeNature() ) { + case BAG: // fall through intentionally + case SET: { + return new PluralAttributeSourceImpl( pluralAssociationAttribute, configuredClass ); + } + case ARRAY: // fall through intentionally + case MAP: // fall through intentionally + case LIST: { + return new IndexedPluralAttributeSourceImpl( pluralAssociationAttribute, configuredClass ); + } + case ID_BAG: { + throw new NotYetImplementedException( + String.format( + "%s attributes are not supported yet", + pluralAssociationAttribute.getPluralAttributeNature() + ) + ); + } + default: { + throw new AssertionFailure( + String.format( + "Unknown plural attribute nature: %s", + pluralAssociationAttribute.getPluralAttributeNature() + ) + ); + } + } + + } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/attribute/PluralAssociationAttribute.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/attribute/PluralAssociationAttribute.java index 1ac03d9ade..f92f23d1c3 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/attribute/PluralAssociationAttribute.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/annotations/attribute/PluralAssociationAttribute.java @@ -37,7 +37,6 @@ import org.jboss.jandex.AnnotationInstance; import org.jboss.jandex.ClassInfo; import org.jboss.jandex.DotName; -import org.hibernate.AnnotationException; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.LazyCollectionOption; @@ -75,7 +74,7 @@ public class PluralAssociationAttribute extends AssociationAttribute { private final ClassInfo entityClassInfo; private final boolean isExtraLazy; private final OnDeleteAction onDeleteAction; - private final boolean isIndexed; + private final boolean isSequentiallyIndexed; // Used for the non-owning side of a ManyToMany relationship private final String inverseForeignKeyName; private final String explicitForeignKeyName; @@ -176,8 +175,8 @@ public class PluralAssociationAttribute extends AssociationAttribute { return sorted; } - public boolean isIndexed() { - return isIndexed; + public boolean isSequentiallyIndexed() { + return isSequentiallyIndexed; } private PluralAssociationAttribute( @@ -260,7 +259,7 @@ public class PluralAssociationAttribute extends AssociationAttribute { getContext().getOrigin() ); } - this.isIndexed = orderColumnAnnotation != null || indexColumnAnnotation != null; + this.isSequentiallyIndexed = orderColumnAnnotation != null || indexColumnAnnotation != null; this.pluralAttributeNature = resolvePluralAttributeNature(); validateMapping(); @@ -305,7 +304,7 @@ public class PluralAssociationAttribute extends AssociationAttribute { return PluralAttributeSource.Nature.MAP; } else if ( List.class.isAssignableFrom( getAttributeType() ) ) { - if ( isIndexed() ) { + if ( isSequentiallyIndexed() ) { return PluralAttributeSource.Nature.LIST; } else if ( isCollectionIdPresent ) { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractComponentAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractComponentAttributeSourceImpl.java index 1b9ea25d5a..fd326b8716 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractComponentAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractComponentAttributeSourceImpl.java @@ -142,35 +142,35 @@ public abstract class AbstractComponentAttributeSourceImpl extends AbstractHbmSo } // todo duplicated with org.hibernate.metamodel.internal.source.hbm.AbstractEntitySourceImpl protected AttributeSource buildAttributeSource(JaxbMapElement attributeElement){ - return new MapAttributeSource( + return new MapSource( sourceMappingDocument(), attributeElement, parentContainer ); } protected AttributeSource buildAttributeSource(JaxbSetElement attributeElement) { - return new SetAttributeSourceImpl( + return new SetSourceImpl( sourceMappingDocument(), attributeElement, parentContainer ); } protected AttributeSource buildAttributeSource(JaxbListElement attributeElement) { - return new ListAttributeSource( + return new ListSourceImpl( sourceMappingDocument(), attributeElement, parentContainer ); } protected AttributeSource buildAttributeSource(JaxbBagElement attributeElement) { - return new BagAttributeSourceImpl( + return new BagSourceImpl( sourceMappingDocument(), attributeElement, parentContainer ); } protected AttributeSource buildAttributeSource(JaxbArrayElement attributeElement) { - return new ArrayAttributeSource( + return new ArraySourceImpl( sourceMappingDocument(), attributeElement, parentContainer diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractEntitySourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractEntitySourceImpl.java index 0c7fc30d56..0e1fe1bf77 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractEntitySourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/AbstractEntitySourceImpl.java @@ -274,7 +274,7 @@ public abstract class AbstractEntitySourceImpl List propertyElements){ for ( JaxbMapElement element : propertyElements ) { results.add( - new MapAttributeSource( + new MapSource( sourceMappingDocument(), element, this ) @@ -285,7 +285,7 @@ public abstract class AbstractEntitySourceImpl List propertyElements){ for ( JaxbArrayElement element : propertyElements ) { results.add( - new ArrayAttributeSource( + new ArraySourceImpl( sourceMappingDocument(), element, this ) @@ -296,7 +296,7 @@ public abstract class AbstractEntitySourceImpl List propertyElements){ for ( JaxbListElement element : propertyElements ) { results.add( - new ListAttributeSource( + new ListSourceImpl( sourceMappingDocument(), element, this ) @@ -307,7 +307,7 @@ public abstract class AbstractEntitySourceImpl List propertyElements){ for ( JaxbSetElement element : propertyElements ) { results.add( - new SetAttributeSourceImpl( + new SetSourceImpl( sourceMappingDocument(), element, this @@ -326,7 +326,7 @@ public abstract class AbstractEntitySourceImpl List propertyElements) { for ( JaxbBagElement element : propertyElements ) { results.add( - new BagAttributeSourceImpl( + new BagSourceImpl( sourceMappingDocument(), element, this diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ArrayAttributeSource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ArraySourceImpl.java similarity index 79% rename from hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ArrayAttributeSource.java rename to hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ArraySourceImpl.java index 8946d2fb95..6dcf54b1e8 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ArrayAttributeSource.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ArraySourceImpl.java @@ -28,24 +28,25 @@ import org.hibernate.jaxb.spi.hbm.JaxbListIndexElement; import org.hibernate.metamodel.spi.source.AttributeSourceContainer; import org.hibernate.metamodel.spi.source.IndexedPluralAttributeSource; import org.hibernate.metamodel.spi.source.PluralAttributeIndexSource; +import org.hibernate.metamodel.spi.source.SequentialPluralAttributeIndexSource; /** * @author Brett Meyer */ -public class ArrayAttributeSource extends AbstractPluralAttributeSourceImpl implements IndexedPluralAttributeSource { +public class ArraySourceImpl extends AbstractPluralAttributeSourceImpl implements IndexedPluralAttributeSource { - private final ListAttributeIndexSource indexSource; + private final SequentialPluralAttributeIndexSource indexSource; - public ArrayAttributeSource( + public ArraySourceImpl( MappingDocument sourceMappingDocument, JaxbArrayElement arrayElement, - AttributeSourceContainer container ) { + AttributeSourceContainer container) { super( sourceMappingDocument, arrayElement, container ); JaxbListIndexElement listIndexElement = arrayElement.getListIndex(); if ( listIndexElement == null ) { - this.indexSource = new ListAttributeIndexSource( sourceMappingDocument(), arrayElement.getIndex() ); + this.indexSource = new SequentialPluralAttributeIndexSourceImpl( sourceMappingDocument(), arrayElement.getIndex() ); } else { - this.indexSource = new ListAttributeIndexSource( sourceMappingDocument(), listIndexElement ); + this.indexSource = new SequentialPluralAttributeIndexSourceImpl( sourceMappingDocument(), listIndexElement ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/BagAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/BagSourceImpl.java similarity index 93% rename from hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/BagAttributeSourceImpl.java rename to hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/BagSourceImpl.java index ff87cc6b21..9f6ffd3608 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/BagAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/BagSourceImpl.java @@ -31,8 +31,8 @@ import org.hibernate.metamodel.spi.source.Orderable; /** * @author Steve Ebersole */ -public class BagAttributeSourceImpl extends AbstractPluralAttributeSourceImpl implements Orderable { - public BagAttributeSourceImpl( +public class BagSourceImpl extends AbstractPluralAttributeSourceImpl implements Orderable { + public BagSourceImpl( MappingDocument sourceMappingDocument, JaxbBagElement bagElement, AttributeSourceContainer container) { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ListAttributeSource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ListSourceImpl.java similarity index 79% rename from hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ListAttributeSource.java rename to hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ListSourceImpl.java index 838b57844d..1cbde62003 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ListAttributeSource.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ListSourceImpl.java @@ -28,29 +28,30 @@ import org.hibernate.jaxb.spi.hbm.JaxbListIndexElement; import org.hibernate.metamodel.spi.source.AttributeSourceContainer; import org.hibernate.metamodel.spi.source.IndexedPluralAttributeSource; import org.hibernate.metamodel.spi.source.PluralAttributeIndexSource; +import org.hibernate.metamodel.spi.source.SequentialPluralAttributeIndexSource; /** * */ -public class ListAttributeSource extends AbstractPluralAttributeSourceImpl implements IndexedPluralAttributeSource { +public class ListSourceImpl extends AbstractPluralAttributeSourceImpl implements IndexedPluralAttributeSource { - private final ListAttributeIndexSource indexSource; + private final SequentialPluralAttributeIndexSource indexSource; /** * @param sourceMappingDocument * @param listElement * @param container */ - public ListAttributeSource( + public ListSourceImpl( MappingDocument sourceMappingDocument, JaxbListElement listElement, - AttributeSourceContainer container ) { + AttributeSourceContainer container) { super( sourceMappingDocument, listElement, container ); JaxbListIndexElement listIndexElement = listElement.getListIndex(); if ( listIndexElement == null ) { - this.indexSource = new ListAttributeIndexSource( sourceMappingDocument(), listElement.getIndex() ); + this.indexSource = new SequentialPluralAttributeIndexSourceImpl( sourceMappingDocument(), listElement.getIndex() ); } else { - this.indexSource = new ListAttributeIndexSource( sourceMappingDocument(), listIndexElement ); + this.indexSource = new SequentialPluralAttributeIndexSourceImpl( sourceMappingDocument(), listIndexElement ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapAttributeIndexSource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapKeySourceImpl.java similarity index 90% rename from hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapAttributeIndexSource.java rename to hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapKeySourceImpl.java index 82b58a3ec5..2317de4467 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapAttributeIndexSource.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapKeySourceImpl.java @@ -30,19 +30,19 @@ import org.hibernate.jaxb.spi.hbm.JaxbColumnElement; import org.hibernate.jaxb.spi.hbm.JaxbIndexElement; import org.hibernate.jaxb.spi.hbm.JaxbMapKeyElement; import org.hibernate.metamodel.spi.binding.PluralAttributeIndexBinding; +import org.hibernate.metamodel.spi.source.BasicPluralAttributeIndexSource; import org.hibernate.metamodel.spi.source.ExplicitHibernateTypeSource; -import org.hibernate.metamodel.spi.source.PluralAttributeIndexSource; import org.hibernate.metamodel.spi.source.RelationalValueSource; /** * */ -public class MapAttributeIndexSource extends AbstractHbmSourceNode implements PluralAttributeIndexSource { +public class MapKeySourceImpl extends AbstractHbmSourceNode implements BasicPluralAttributeIndexSource { private final PluralAttributeIndexBinding.Nature nature; private final List valueSources; private final ExplicitHibernateTypeSource typeSource; - public MapAttributeIndexSource(MappingDocument sourceMappingDocument, final JaxbMapKeyElement mapKey) { + public MapKeySourceImpl(MappingDocument sourceMappingDocument, final JaxbMapKeyElement mapKey) { super( sourceMappingDocument ); valueSources = Helper.buildValueSources( sourceMappingDocument(), @@ -101,7 +101,7 @@ public class MapAttributeIndexSource extends AbstractHbmSourceNode implements Pl this.nature = PluralAttributeIndexBinding.Nature.BASIC; } - public MapAttributeIndexSource(MappingDocument sourceMappingDocument, final JaxbIndexElement indexElement) { + public MapKeySourceImpl(MappingDocument sourceMappingDocument, final JaxbIndexElement indexElement) { super( sourceMappingDocument ); valueSources = Helper.buildValueSources( sourceMappingDocument, @@ -136,7 +136,7 @@ public class MapAttributeIndexSource extends AbstractHbmSourceNode implements Pl @Override public Map getParameters() { - return java.util.Collections.emptyMap(); + return java.util.Collections.emptyMap(); } }; @@ -172,9 +172,4 @@ public class MapAttributeIndexSource extends AbstractHbmSourceNode implements Pl public List relationalValueSources() { return valueSources; } - - @Override - public int base() { - return 0; - } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapAttributeSource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapSource.java similarity index 83% rename from hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapAttributeSource.java rename to hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapSource.java index 96d82e096b..ff74df46be 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapAttributeSource.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/MapSource.java @@ -33,28 +33,28 @@ import org.hibernate.metamodel.spi.source.IndexedPluralAttributeSource; /** * */ -public class MapAttributeSource extends AbstractPluralAttributeSourceImpl implements IndexedPluralAttributeSource { +public class MapSource extends AbstractPluralAttributeSourceImpl implements IndexedPluralAttributeSource { - private final MapAttributeIndexSource indexSource; + private final MapKeySourceImpl indexSource; /** * @param sourceMappingDocument * @param pluralAttributeElement * @param container */ - public MapAttributeSource( + public MapSource( MappingDocument sourceMappingDocument, JaxbMapElement mapElement, - AttributeSourceContainer container ) { + AttributeSourceContainer container) { super( sourceMappingDocument, mapElement, container ); JaxbMapKeyElement mapKey = mapElement.getMapKey(); if ( mapKey != null ) { - this.indexSource = new MapAttributeIndexSource( sourceMappingDocument, mapKey ); + this.indexSource = new MapKeySourceImpl( sourceMappingDocument, mapKey ); } else { JaxbIndexElement indexElement = mapElement.getIndex(); if ( indexElement != null ) { - this.indexSource = new MapAttributeIndexSource( sourceMappingDocument, indexElement ); + this.indexSource = new MapKeySourceImpl( sourceMappingDocument, indexElement ); } throw new NotYetImplementedException( ", , , , , and " ); @@ -62,7 +62,7 @@ public class MapAttributeSource extends AbstractPluralAttributeSourceImpl implem } @Override - public MapAttributeIndexSource getIndexSource() { + public MapKeySourceImpl getIndexSource() { return indexSource; } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ListAttributeIndexSource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/SequentialPluralAttributeIndexSourceImpl.java similarity index 90% rename from hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ListAttributeIndexSource.java rename to hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/SequentialPluralAttributeIndexSourceImpl.java index 12d402b5a1..8dc0c2776c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/ListAttributeIndexSource.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/SequentialPluralAttributeIndexSourceImpl.java @@ -33,18 +33,18 @@ import org.hibernate.jaxb.spi.hbm.JaxbIndexElement; import org.hibernate.jaxb.spi.hbm.JaxbListIndexElement; import org.hibernate.metamodel.spi.binding.PluralAttributeIndexBinding; import org.hibernate.metamodel.spi.source.ExplicitHibernateTypeSource; -import org.hibernate.metamodel.spi.source.PluralAttributeIndexSource; +import org.hibernate.metamodel.spi.source.SequentialPluralAttributeIndexSource; import org.hibernate.metamodel.spi.source.RelationalValueSource; /** * */ -public class ListAttributeIndexSource extends AbstractHbmSourceNode implements PluralAttributeIndexSource { +public class SequentialPluralAttributeIndexSourceImpl extends AbstractHbmSourceNode implements SequentialPluralAttributeIndexSource { private final List< RelationalValueSource > valueSources; private final ExplicitHibernateTypeSource typeSource; private final int base; - public ListAttributeIndexSource( MappingDocument sourceMappingDocument, final JaxbListIndexElement indexElement ) { + public SequentialPluralAttributeIndexSourceImpl(MappingDocument sourceMappingDocument, final JaxbListIndexElement indexElement) { super( sourceMappingDocument ); valueSources = Helper.buildValueSources( sourceMappingDocument, new Helper.ValueSourcesAdapter() { @@ -85,7 +85,7 @@ public class ListAttributeIndexSource extends AbstractHbmSourceNode implements P base = Integer.parseInt( indexElement.getBase() ); } - public ListAttributeIndexSource( MappingDocument sourceMappingDocument, final JaxbIndexElement indexElement ) { + public SequentialPluralAttributeIndexSourceImpl(MappingDocument sourceMappingDocument, final JaxbIndexElement indexElement) { super( sourceMappingDocument ); valueSources = Helper.buildValueSources( sourceMappingDocument, new Helper.ValueSourcesAdapter() { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/SetAttributeSourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/SetSourceImpl.java similarity index 94% rename from hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/SetAttributeSourceImpl.java rename to hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/SetSourceImpl.java index 01d86219bf..7a1560284f 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/SetAttributeSourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/SetSourceImpl.java @@ -32,8 +32,8 @@ import org.hibernate.metamodel.spi.source.Sortable; /** * @author Steve Ebersole */ -public class SetAttributeSourceImpl extends AbstractPluralAttributeSourceImpl implements Orderable, Sortable { - public SetAttributeSourceImpl( +public class SetSourceImpl extends AbstractPluralAttributeSourceImpl implements Orderable, Sortable { + public SetSourceImpl( MappingDocument sourceMappingDocument, JaxbSetElement setElement, AttributeSourceContainer container) { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/binding/AbstractPluralAttributeBinding.java b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/binding/AbstractPluralAttributeBinding.java index fcaf86b312..54d3216652 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/binding/AbstractPluralAttributeBinding.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/binding/AbstractPluralAttributeBinding.java @@ -59,7 +59,6 @@ public abstract class AbstractPluralAttributeBinding extends AbstractAttributeBi private String where; private String orderBy; private boolean sorted; - private boolean index; private Comparator< ? > comparator; private String customLoaderName; @@ -252,11 +251,7 @@ public abstract class AbstractPluralAttributeBinding extends AbstractAttributeBi } @Override public boolean hasIndex() { - return index; - } - - public void setIndex(boolean index) { - this.index = index; + return IndexedPluralAttributeBinding.class.isInstance( this ); } @Override diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/BasicPluralAttributeIndexSource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/BasicPluralAttributeIndexSource.java new file mode 100644 index 0000000000..263cd334e6 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/BasicPluralAttributeIndexSource.java @@ -0,0 +1,31 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2013, 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.metamodel.spi.source; + +/** + * @author Gail Badner + */ +public interface BasicPluralAttributeIndexSource extends PluralAttributeIndexSource { + ExplicitHibernateTypeSource explicitHibernateTypeSource(); +} diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeIndexSource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeIndexSource.java index ce99eba611..0b6bcd5aea 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeIndexSource.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/PluralAttributeIndexSource.java @@ -30,6 +30,4 @@ import org.hibernate.metamodel.spi.binding.PluralAttributeIndexBinding; */ public interface PluralAttributeIndexSource extends RelationalValueSourceContainer { PluralAttributeIndexBinding.Nature getNature(); - ExplicitHibernateTypeSource explicitHibernateTypeSource(); - int base(); } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/SequentialPluralAttributeIndexSource.java b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/SequentialPluralAttributeIndexSource.java new file mode 100644 index 0000000000..10a5047a1c --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/spi/source/SequentialPluralAttributeIndexSource.java @@ -0,0 +1,31 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2013, 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.metamodel.spi.source; + +/** + * @author Gail Badner + */ +public interface SequentialPluralAttributeIndexSource extends BasicPluralAttributeIndexSource { + int base(); +}