diff --git a/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc b/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc index 5cc8263e10..59e0a5daa5 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc @@ -156,7 +156,7 @@ after the collection is loaded, the collection would need to be refreshed to re- the elements. For this reason, ordered sets are not recommended - if the application needs ordering of the set elements, a sorted set should be preferred. For this reason, it is not covered in the User Guide. See the javadocs for `jakarta.persistence.OrderBy` -or `org.hibernate.annotations.OrderBy` for details. +or `org.hibernate.annotations.SQLOrder` for details. There are 2 options for sorting a set - naturally or using an explicit comparator. diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/DialectOverride.java b/hibernate-core/src/main/java/org/hibernate/annotations/DialectOverride.java index 6d9f0d54ca..b42fbd2267 100644 --- a/hibernate-core/src/main/java/org/hibernate/annotations/DialectOverride.java +++ b/hibernate-core/src/main/java/org/hibernate/annotations/DialectOverride.java @@ -90,33 +90,6 @@ public interface DialectOverride { Check[] value(); } - /** - * Specializes an {@link org.hibernate.annotations.OrderBy} - * in a certain dialect. - * - * @deprecated Use {@link SQLOrder} - */ - @Target({METHOD, FIELD}) - @Retention(RUNTIME) - @Repeatable(OrderBys.class) - @OverridesAnnotation(org.hibernate.annotations.OrderBy.class) - @Deprecated(since = "6.3", forRemoval = true) - @interface OrderBy { - /** - * The {@link Dialect} in which this override applies. - */ - Class dialect(); - Version before() default @Version(major = MAX_VALUE); - Version sameOrAfter() default @Version(major = MIN_VALUE); - - org.hibernate.annotations.OrderBy override(); - } - @Target({METHOD, FIELD}) - @Retention(RUNTIME) - @interface OrderBys { - OrderBy[] value(); - } - /** * Specializes an {@link org.hibernate.annotations.SQLOrder} * in a certain dialect. diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/OrderBy.java b/hibernate-core/src/main/java/org/hibernate/annotations/OrderBy.java deleted file mode 100644 index 897f5ed2c7..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/annotations/OrderBy.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * SPDX-License-Identifier: LGPL-2.1-or-later - * Copyright Red Hat Inc. and Hibernate Authors - */ -package org.hibernate.annotations; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Order a collection using an expression written in native SQL. - *

- * The order is applied by the database when the collection is fetched, - * but is not maintained by operations that mutate the collection in - * memory. - *

- * If the collection is a {@link java.util.Set} or {@link java.util.Map}, - * the order is maintained using a {@link java.util.LinkedHashSet} or - * {@link java.util.LinkedHashMap}. If the collection is a bag or - * {@link java.util.List}, the order is maintained by the underlying - * {@link java.util.ArrayList}. - *

- * There are several other ways to order or sort a collection: - *

- *

- * It's illegal to use {@code OrderBy} together with the JPA-defined - * {@link jakarta.persistence.OrderBy} for the same collection. - * - * @see jakarta.persistence.OrderBy - * @see SortComparator - * @see SortNatural - * - * @author Emmanuel Bernard - * @author Steve Ebersole - * - * @see DialectOverride.OrderBy - * - * @deprecated Use {@link SQLOrder} instead. This annotation will be - * removed eventually, since its unqualified name collides - * with {@link jakarta.persistence.OrderBy}. - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -@Deprecated(since = "6.3", forRemoval = true) -public @interface OrderBy { - /** - * The native SQL expression used to sort the collection elements. - */ - String clause(); -} diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java index bc88549c93..2ce729021b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java @@ -237,7 +237,6 @@ public abstract class CollectionBinder { private boolean hibernateExtensionMapping; private jakarta.persistence.OrderBy jpaOrderBy; - private org.hibernate.annotations.OrderBy sqlOrderBy; private SQLOrder sqlOrder; private SortNatural naturalSort; private SortComparator comparatorSort; @@ -287,7 +286,6 @@ public abstract class CollectionBinder { collectionBinder.setMapKey( property.getAnnotationUsage( MapKey.class, sourceModelContext ) ); collectionBinder.setPropertyName( inferredData.getPropertyName() ); collectionBinder.setJpaOrderBy( property.getAnnotationUsage( OrderBy.class, sourceModelContext ) ); - collectionBinder.setSqlOrderBy( getOverridableAnnotation( property, org.hibernate.annotations.OrderBy.class, context ) ); collectionBinder.setSqlOrder( getOverridableAnnotation( property, SQLOrder.class, context ) ); collectionBinder.setNaturalSort( property.getAnnotationUsage( SortNatural.class, sourceModelContext ) ); collectionBinder.setComparatorSort( property.getAnnotationUsage( SortComparator.class, sourceModelContext ) ); @@ -841,11 +839,6 @@ public abstract class CollectionBinder { this.jpaOrderBy = jpaOrderBy; } - @SuppressWarnings("removal") - public void setSqlOrderBy(org.hibernate.annotations.OrderBy sqlOrderBy) { - this.sqlOrderBy = sqlOrderBy; - } - public void setSqlOrder(SQLOrder sqlOrder) { this.sqlOrder = sqlOrder; } @@ -1095,7 +1088,7 @@ public abstract class CollectionBinder { } if ( property.hasDirectAnnotationUsage( jakarta.persistence.OrderBy.class ) - || property.hasDirectAnnotationUsage( org.hibernate.annotations.OrderBy.class ) ) { + || property.hasDirectAnnotationUsage( org.hibernate.annotations.SQLOrder.class ) ) { return CollectionClassification.BAG; } @@ -1443,15 +1436,12 @@ public abstract class CollectionBinder { comparatorClass = null; } - if ( jpaOrderBy != null && ( sqlOrderBy != null || sqlOrder != null ) ) { + if ( jpaOrderBy != null && sqlOrder != null ) { throw buildIllegalOrderCombination(); } - boolean ordered = jpaOrderBy != null || sqlOrderBy != null || sqlOrder != null ; + final boolean ordered = jpaOrderBy != null || sqlOrder != null ; if ( ordered ) { // we can only apply the sql-based order by up front. The jpa order by has to wait for second pass - if ( sqlOrderBy != null ) { - collection.setOrderBy( sqlOrderBy.clause() ); - } if ( sqlOrder != null ) { collection.setOrderBy( sqlOrder.value() ); } @@ -1490,7 +1480,7 @@ public abstract class CollectionBinder { "Collection '%s' is annotated both '@%s' and '@%s'", safeCollectionRole(), jakarta.persistence.OrderBy.class.getName(), - org.hibernate.annotations.OrderBy.class.getName() + org.hibernate.annotations.SQLOrder.class.getName() ) ); } @@ -1502,7 +1492,7 @@ public abstract class CollectionBinder { "Collection '%s' is both sorted and ordered (only one of '@%s', '@%s', '@%s', and '@%s' may be used)", safeCollectionRole(), jakarta.persistence.OrderBy.class.getName(), - org.hibernate.annotations.OrderBy.class.getName(), + org.hibernate.annotations.SQLOrder.class.getName(), SortComparator.class.getName(), SortNatural.class.getName() ) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ListBinder.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ListBinder.java index 3785495682..7154104560 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ListBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/ListBinder.java @@ -7,9 +7,7 @@ package org.hibernate.boot.model.internal; import java.util.Map; import java.util.function.Supplier; -import org.hibernate.AnnotationException; import org.hibernate.MappingException; -import org.hibernate.annotations.OrderBy; import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.boot.spi.SecondPass; import org.hibernate.mapping.Collection; @@ -47,13 +45,6 @@ public class ListBinder extends CollectionBinder { return new List( getCustomTypeBeanResolver(), owner, getBuildingContext() ); } - @Override - public void setSqlOrderBy(OrderBy orderByAnn) { - if ( orderByAnn != null ) { - throw new AnnotationException( "A collection of type 'List' is annotated '@OrderBy'" ); - } - } - @Override public SecondPass getSecondPass() { return new CollectionSecondPass( ListBinder.this.collection ) { diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/SetBinder.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/SetBinder.java index cda391f885..1e380d6fbb 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/SetBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/SetBinder.java @@ -6,7 +6,6 @@ package org.hibernate.boot.model.internal; import java.util.function.Supplier; -import org.hibernate.annotations.OrderBy; import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.mapping.Collection; import org.hibernate.mapping.PersistentClass; @@ -34,10 +33,4 @@ public class SetBinder extends CollectionBinder { return new Set( getCustomTypeBeanResolver(), persistentClass, getBuildingContext() ); } - @Override - public void setSqlOrderBy(OrderBy orderByAnn) { - if ( orderByAnn != null ) { - super.setSqlOrderBy( orderByAnn ); - } - } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/DialectOverrideAnnotations.java b/hibernate-core/src/main/java/org/hibernate/boot/models/DialectOverrideAnnotations.java index 4e8e82a72d..18f6b64350 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/DialectOverrideAnnotations.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/DialectOverrideAnnotations.java @@ -27,8 +27,6 @@ import org.hibernate.boot.models.annotations.internal.OverriddenGeneratedColumnA import org.hibernate.boot.models.annotations.internal.OverriddenGeneratedColumnsAnnotation; import org.hibernate.boot.models.annotations.internal.OverriddenJoinFormulaAnnotation; import org.hibernate.boot.models.annotations.internal.OverriddenJoinFormulasAnnotation; -import org.hibernate.boot.models.annotations.internal.OverriddenOrderByAnnotation; -import org.hibernate.boot.models.annotations.internal.OverriddenOrderBysAnnotation; import org.hibernate.boot.models.annotations.internal.OverriddenSQLDeleteAllAnnotation; import org.hibernate.boot.models.annotations.internal.OverriddenSQLDeleteAllsAnnotation; import org.hibernate.boot.models.annotations.internal.OverriddenSQLDeleteAnnotation; @@ -61,15 +59,6 @@ public interface DialectOverrideAnnotations { OverriddenCheckAnnotation.class, DIALECT_OVERRIDE_CHECKS ); - OrmAnnotationDescriptor DIALECT_OVERRIDE_ORDER_BYS = new OrmAnnotationDescriptor<>( - DialectOverride.OrderBys.class, - OverriddenOrderBysAnnotation.class - ); - OrmAnnotationDescriptor DIALECT_OVERRIDE_ORDER_BY = new OrmAnnotationDescriptor<>( - DialectOverride.OrderBy.class, - OverriddenOrderByAnnotation.class, - DIALECT_OVERRIDE_ORDER_BYS - ); OrmAnnotationDescriptor DIALECT_OVERRIDE_COLUMN_DEFAULTS = new OrmAnnotationDescriptor<>( DialectOverride.ColumnDefaults.class, OverriddenColumnDefaultsAnnotation.class diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/HibernateAnnotations.java b/hibernate-core/src/main/java/org/hibernate/boot/models/HibernateAnnotations.java index 63bf9170b3..8d0f917cee 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/HibernateAnnotations.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/models/HibernateAnnotations.java @@ -470,10 +470,6 @@ public interface HibernateAnnotations { OptimisticLocking.class, OptimisticLockingAnnotation.class ); - OrmAnnotationDescriptor ORDER_BY = new OrmAnnotationDescriptor<>( - OrderBy.class, - OrderByAnnotation.class - ); OrmAnnotationDescriptor PARAM_DEF = new OrmAnnotationDescriptor<>( ParamDef.class, ParamDefAnnotation.class diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByAnnotation.java deleted file mode 100644 index 8ee4390977..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OrderByAnnotation.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SPDX-License-Identifier: LGPL-2.1-or-later - * Copyright Red Hat Inc. and Hibernate Authors - */ -package org.hibernate.boot.models.annotations.internal; - -import java.lang.annotation.Annotation; -import java.util.Map; - -import org.hibernate.annotations.OrderBy; -import org.hibernate.models.spi.SourceModelBuildingContext; - -@SuppressWarnings({ "ClassExplicitlyAnnotation", "unused" }) -@jakarta.annotation.Generated("org.hibernate.orm.build.annotations.ClassGeneratorProcessor") -public class OrderByAnnotation implements OrderBy { - private String clause; - - /** - * Used in creating dynamic annotation instances (e.g. from XML) - */ - public OrderByAnnotation(SourceModelBuildingContext modelContext) { - this.clause = ""; - } - - /** - * Used in creating annotation instances from JDK variant - */ - public OrderByAnnotation(OrderBy annotation, SourceModelBuildingContext modelContext) { - clause = annotation.clause(); - } - - /** - * Used in creating annotation instances from Jandex variant - */ - public OrderByAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { - clause = (String) attributeValues.get( "clause" ); - } - - @Override - public Class annotationType() { - return OrderBy.class; - } - - @Override - public String clause() { - return clause; - } - - public void clause(String value) { - this.clause = value; - } - - -} diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderByAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderByAnnotation.java deleted file mode 100644 index 0de946e055..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderByAnnotation.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * SPDX-License-Identifier: LGPL-2.1-or-later - * Copyright Red Hat Inc. and Hibernate Authors - */ -package org.hibernate.boot.models.annotations.internal; - -import java.lang.annotation.Annotation; -import java.util.Map; - -import org.hibernate.annotations.DialectOverride; -import org.hibernate.annotations.OrderBy; -import org.hibernate.boot.models.HibernateAnnotations; -import org.hibernate.boot.models.annotations.spi.AbstractOverrider; -import org.hibernate.boot.models.annotations.spi.DialectOverrider; -import org.hibernate.models.spi.AnnotationDescriptor; -import org.hibernate.models.spi.SourceModelBuildingContext; - -import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_ORDER_BY; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; - -/** - * @author Steve Ebersole - */ -@SuppressWarnings("ClassExplicitlyAnnotation") -public class OverriddenOrderByAnnotation - extends AbstractOverrider - implements DialectOverride.OrderBy, DialectOverrider { - private OrderBy override; - - /** - * Used in creating dynamic annotation instances (e.g. from XML) - */ - public OverriddenOrderByAnnotation(SourceModelBuildingContext sourceModelContext) { - } - - /** - * Used in creating annotation instances from JDK variant - */ - public OverriddenOrderByAnnotation( - DialectOverride.OrderBy annotation, - SourceModelBuildingContext sourceModelContext) { - dialect( annotation.dialect() ); - before( annotation.before() ); - sameOrAfter( annotation.sameOrAfter() ); - override( extractJdkValue( annotation, DIALECT_OVERRIDE_ORDER_BY, "override", sourceModelContext ) ); - } - - /** - * Used in creating annotation instances from Jandex variant - */ - public OverriddenOrderByAnnotation( - Map attributeValues, - SourceModelBuildingContext sourceModelContext) { - super( attributeValues, DIALECT_OVERRIDE_ORDER_BY, sourceModelContext ); - override( (OrderBy) attributeValues.get( "override" ) ); - } - - @Override - public AnnotationDescriptor getOverriddenDescriptor() { - return HibernateAnnotations.ORDER_BY; - } - - @Override - public OrderBy override() { - return override; - } - - public void override(OrderBy value) { - this.override = value; - } - - @Override - public Class annotationType() { - return DialectOverride.OrderBy.class; - } -} diff --git a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderBysAnnotation.java b/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderBysAnnotation.java deleted file mode 100644 index 3bb0cd1d8a..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/boot/models/annotations/internal/OverriddenOrderBysAnnotation.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * SPDX-License-Identifier: LGPL-2.1-or-later - * Copyright Red Hat Inc. and Hibernate Authors - */ -package org.hibernate.boot.models.annotations.internal; - -import java.lang.annotation.Annotation; -import java.util.Map; - -import org.hibernate.annotations.DialectOverride; -import org.hibernate.boot.models.annotations.spi.RepeatableContainer; -import org.hibernate.models.spi.SourceModelBuildingContext; - -import static org.hibernate.boot.models.DialectOverrideAnnotations.DIALECT_OVERRIDE_ORDER_BYS; -import static org.hibernate.boot.models.internal.OrmAnnotationHelper.extractJdkValue; - -/** - * @author Steve Ebersole - */ -@SuppressWarnings("ClassExplicitlyAnnotation") -public class OverriddenOrderBysAnnotation - implements DialectOverride.OrderBys, RepeatableContainer { - private DialectOverride.OrderBy[] value; - - /** - * Used in creating dynamic annotation instances (e.g. from XML) - */ - public OverriddenOrderBysAnnotation(SourceModelBuildingContext modelContext) { - } - - /** - * Used in creating annotation instances from JDK variant - */ - public OverriddenOrderBysAnnotation(DialectOverride.OrderBys annotation, SourceModelBuildingContext modelContext) { - this.value = extractJdkValue( annotation, DIALECT_OVERRIDE_ORDER_BYS, "value", modelContext ); - } - - /** - * Used in creating annotation instances from Jandex variant - */ - public OverriddenOrderBysAnnotation(Map attributeValues, SourceModelBuildingContext modelContext) { - this.value = (DialectOverride.OrderBy[]) attributeValues.get( "value" ); - } - - @Override - public DialectOverride.OrderBy[] value() { - return value; - } - - @Override - public void value(DialectOverride.OrderBy[] value) { - this.value = value; - } - - @Override - public Class annotationType() { - return DialectOverride.OrderBys.class; - } -} diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/CollectionClassification.java b/hibernate-core/src/main/java/org/hibernate/metamodel/CollectionClassification.java index 47afa56b03..178037e11c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/CollectionClassification.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/CollectionClassification.java @@ -67,7 +67,7 @@ public enum CollectionClassification { * as {@link java.util.Set}. * * @see jakarta.persistence.OrderBy - * @see org.hibernate.annotations.OrderBy + * @see org.hibernate.annotations.SQLOrder */ ORDERED_SET( PluralAttribute.CollectionType.SET, false ), @@ -93,7 +93,7 @@ public enum CollectionClassification { * as {@link java.util.Map}. * * @see jakarta.persistence.OrderBy - * @see org.hibernate.annotations.OrderBy + * @see org.hibernate.annotations.SQLOrder */ ORDERED_MAP( PluralAttribute.CollectionType.MAP, true ); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ordering/OrderByFragmentTranslator.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ordering/OrderByFragmentTranslator.java index 09f1f0521d..f7cef21e2f 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ordering/OrderByFragmentTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ordering/OrderByFragmentTranslator.java @@ -24,8 +24,8 @@ import org.antlr.v4.runtime.misc.ParseCancellationException; * with an order set or map. * * @author Steve Ebersole + * * @see jakarta.persistence.OrderBy - * @see org.hibernate.annotations.OrderBy */ public class OrderByFragmentTranslator { private static final Logger LOG = Logger.getLogger( OrderByFragmentTranslator.class.getName() ); diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ordering/package-info.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ordering/package-info.java index 0c224f25b3..3e4063d908 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ordering/package-info.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/ordering/package-info.java @@ -9,6 +9,6 @@ * Support for set and map ordering * * @see jakarta.persistence.OrderBy - * @see org.hibernate.annotations.OrderBy + * @see org.hibernate.annotations.SQLOrder */ package org.hibernate.metamodel.mapping.ordering; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/collections/SortNaturalByDefaultTests.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/collections/SortNaturalByDefaultTests.java index e8ea60e30d..203397ac8c 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/collections/SortNaturalByDefaultTests.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/collections/SortNaturalByDefaultTests.java @@ -34,7 +34,6 @@ import static org.hamcrest.MatcherAssert.assertThat; *

* diff --git a/migration-guide.adoc b/migration-guide.adoc index 02aeed9660..a5eac6082d 100644 --- a/migration-guide.adoc +++ b/migration-guide.adoc @@ -429,15 +429,15 @@ In Hibernate 7, these SQL `UPDATE` statements only occur if the `@OrderColumn` i ** Removed `@SelectBeforeUpdate` ** Removed `@DynamicInsert#value` and `@DynamicUpdate#value` ** Removed `@Loader` -** Removed `@Table` -** Removed `@Where` and `@WhereJoinTable` -** Removed `@ForeignKey` -** Removed `@Index` -** Removed `@IndexColumn` +** Removed `@Table` -> use JPA `@Table` +** Removed `@Where` and `@WhereJoinTable` -> use `@SQLRestriction` or `@SQLJoinTableRestriction` +** Removed `@OrderBy` -> use `@SQLOrder` or JPA `@OrderBy` +** Removed `@ForeignKey` -> use JPA `@ForeignKey` +** Removed `@Index` -> use JPA `@Index` +** Removed `@IndexColumn` -> use JPA `@OrderColumn` ** Removed `@GeneratorType` (and `GenerationTime`, etc) ** Removed `@LazyToOne` ** Removed `@LazyCollection` -** Removed `@IndexColumn` ** Replaced uses of `CacheModeType` with `CacheMode` ** Removed `@TestForIssue` (for testing purposes) -> use `org.hibernate.testing.orm.junit.JiraKey` and `org.hibernate.testing.orm.junit.JiraKeyGroup`