From ffb14b28b72c67dc2d658bfeb89545ca16eb3399 Mon Sep 17 00:00:00 2001 From: Strong Liu Date: Mon, 27 Jun 2011 22:58:18 +0800 Subject: [PATCH] HHH-6368 remove deprecated hibernate annotations --- .../annotations/CollectionOfElements.java | 50 ---------------- .../annotations/ForceDiscriminator.java | 40 ------------- .../org/hibernate/annotations/MapKey.java | 57 ------------------- .../annotations/MapKeyManyToMany.java | 51 ----------------- .../org/hibernate/cfg/AnnotationBinder.java | 35 +----------- .../org/hibernate/cfg/ColumnsBuilder.java | 2 - .../cfg/annotations/CollectionBinder.java | 9 +-- .../hibernate/cfg/annotations/MapBinder.java | 25 +++----- .../JPAOverridenAnnotationReader.java | 36 ------------ .../test/annotations/any/PropertyMap.java | 4 +- .../annotations/collectionelement/Boy.java | 6 +- .../CollectionElementTest.java | 2 +- .../indexedCollection/Sale.java | 5 +- .../annotations/embedded/EmbeddedTest.java | 2 +- .../annotations/embedded/WealthyPerson.java | 14 +---- .../annotations/indexcoll/Atmosphere.java | 6 +- .../indexcoll/IndexedCollectionTest.java | 5 +- .../inheritance/singletable/Building.java | 2 - .../annotations/override/PropertyRecord.java | 16 +++--- .../test/annotations/target/Brand.java | 4 +- .../entities/collection/EnumSetEntity.java | 6 +- .../entities/collection/StringListEntity.java | 4 +- .../entities/collection/StringMapEntity.java | 4 +- .../entities/collection/StringSetEntity.java | 4 +- .../test/integration/hashcode/WikiPage.java | 4 +- .../manytomany/ternary/TernaryMapEntity.java | 3 +- ...onsJoinTableRangeTestEntitySuperClass.java | 1 - .../performance/complex/ChildEntity2.java | 4 +- 28 files changed, 49 insertions(+), 352 deletions(-) delete mode 100644 hibernate-core/src/main/java/org/hibernate/annotations/CollectionOfElements.java delete mode 100644 hibernate-core/src/main/java/org/hibernate/annotations/ForceDiscriminator.java delete mode 100644 hibernate-core/src/main/java/org/hibernate/annotations/MapKey.java delete mode 100644 hibernate-core/src/main/java/org/hibernate/annotations/MapKeyManyToMany.java diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/CollectionOfElements.java b/hibernate-core/src/main/java/org/hibernate/annotations/CollectionOfElements.java deleted file mode 100644 index e967b364ab..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/annotations/CollectionOfElements.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * Copyright (c) 2010, 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.annotations; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import javax.persistence.FetchType; - -/** - * Annotation used to mark a collection as a collection of elements or - * a collection of embedded objects - * - * @deprecated use @ElementCollection - * @author Emmanuel Bernard - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -@Deprecated -public @interface CollectionOfElements { - /** - * Represent the element class in the collection - * Only useful if the collection does not use generics - */ - Class targetElement() default void.class; - - FetchType fetch() default FetchType.LAZY; -} diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/ForceDiscriminator.java b/hibernate-core/src/main/java/org/hibernate/annotations/ForceDiscriminator.java deleted file mode 100644 index ec9c7c3e3b..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/annotations/ForceDiscriminator.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * Copyright (c) 2010, 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.annotations; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * ForceDiscriminator flag - * To be placed at the root entity near @DiscriminatorColumn or @DiscriminatorFormula - * - * @author Serg Prasolov - * @deprecated use {@link org.hibernate.annotations.DiscriminatorOptions} instead - */ -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -public @interface ForceDiscriminator { -} diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/MapKey.java b/hibernate-core/src/main/java/org/hibernate/annotations/MapKey.java deleted file mode 100644 index 271119ba31..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/annotations/MapKey.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * Copyright (c) 2010, 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.annotations; -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.RUNTIME; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; -import javax.persistence.Column; - -/** - * Define the map key columns as an explicit column holding the map key - * This is completely different from {@link javax.persistence.MapKey} which use an existing column - * This annotation and {@link javax.persistence.MapKey} are mutually exclusive - * - * @deprecated Use {@link javax.persistence.MapKeyColumn} - * This is the default behavior for Map properties marked as @OneToMany, @ManyToMany - * or @ElementCollection - * @author Emmanuel Bernard - */ -@Target({METHOD, FIELD}) -@Retention(RUNTIME) -@Deprecated -public @interface MapKey { - Column[] columns() default {}; - /** - * Represent the key class in a Map - * Only useful if the collection does not use generics - */ - Class targetElement() default void.class; - - /** - * The optional map key type. Guessed if default - */ - Type type() default @Type(type = ""); -} diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/MapKeyManyToMany.java b/hibernate-core/src/main/java/org/hibernate/annotations/MapKeyManyToMany.java deleted file mode 100644 index b3582e65f7..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/annotations/MapKeyManyToMany.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * Copyright (c) 2010, 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.annotations; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.persistence.JoinColumn; - -/** - * Define the map key columns as an explicit column holding the map key - * This is completely different from {@link javax.persistence.MapKey} which use an existing column - * This annotation and {@link javax.persistence.MapKey} are mutually exclusive - * - * @deprecated Use {@link javax.persistence.MapKeyJoinColumn} {@link javax.persistence.MapKeyJoinColumns} - * This is the default behavior for Map properties marked as @OneToMany, @ManyToMany - * or @ElementCollection - * @author Emmanuel Bernard - */ -@Target({ElementType.METHOD, ElementType.FIELD}) -@Retention(RetentionPolicy.RUNTIME) -@Deprecated -public @interface MapKeyManyToMany { - JoinColumn[] joinColumns() default {}; - /** - * Represent the key class in a Map - * Only useful if the collection does not use generics - */ - Class targetEntity() default void.class; -} diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java index bdd20df8ca..d91a471943 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java @@ -93,7 +93,6 @@ import org.hibernate.annotations.Cascade; import org.hibernate.annotations.CascadeType; import org.hibernate.annotations.Check; import org.hibernate.annotations.CollectionId; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.annotations.Columns; import org.hibernate.annotations.DiscriminatorOptions; import org.hibernate.annotations.Fetch; @@ -103,7 +102,6 @@ import org.hibernate.annotations.Filter; import org.hibernate.annotations.FilterDef; import org.hibernate.annotations.FilterDefs; import org.hibernate.annotations.Filters; -import org.hibernate.annotations.ForceDiscriminator; import org.hibernate.annotations.ForeignKey; import org.hibernate.annotations.Formula; import org.hibernate.annotations.GenericGenerator; @@ -737,11 +735,6 @@ public final class AnnotationBinder { null; entityBinder.setDiscriminatorValue( discrimValue ); - if ( clazzToProcess.isAnnotationPresent( ForceDiscriminator.class ) ) { - LOG.deprecatedForceDescriminatorAnnotation(); - entityBinder.setForceDiscriminator( true ); - } - DiscriminatorOptions discriminatorOptions = clazzToProcess.getAnnotation( DiscriminatorOptions.class ); if ( discriminatorOptions != null) { entityBinder.setForceDiscriminator( discriminatorOptions.force() ); @@ -1651,13 +1644,11 @@ public final class AnnotationBinder { } else if ( property.isAnnotationPresent( OneToMany.class ) || property.isAnnotationPresent( ManyToMany.class ) - || property.isAnnotationPresent( CollectionOfElements.class ) //legacy Hibernate || property.isAnnotationPresent( ElementCollection.class ) || property.isAnnotationPresent( ManyToAny.class ) ) { OneToMany oneToManyAnn = property.getAnnotation( OneToMany.class ); ManyToMany manyToManyAnn = property.getAnnotation( ManyToMany.class ); ElementCollection elementCollectionAnn = property.getAnnotation( ElementCollection.class ); - CollectionOfElements collectionOfElementsAnn = property.getAnnotation( CollectionOfElements.class ); //legacy hibernate final IndexColumn indexColumn; @@ -1684,9 +1675,7 @@ public final class AnnotationBinder { propertyHolder.getEntityName(), property, !indexColumn.isImplicit(), - property.isAnnotationPresent( CollectionOfElements.class ) - || property.isAnnotationPresent( org.hibernate.annotations.MapKey.class ) - || property.isAnnotationPresent( MapKeyType.class ) + property.isAnnotationPresent( MapKeyType.class ) // || property.isAnnotationPresent( ManyToAny.class ) ); @@ -1759,12 +1748,6 @@ public final class AnnotationBinder { isJPA2 = Boolean.TRUE; keyColumns = new Column[] { new MapKeyColumnDelegator( property.getAnnotation( MapKeyColumn.class ) ) }; } - else if ( property.isAnnotationPresent( org.hibernate.annotations.MapKey.class ) ) { - if ( isJPA2 == null ) { - isJPA2 = Boolean.FALSE; - } - keyColumns = property.getAnnotation( org.hibernate.annotations.MapKey.class ).columns(); - } //not explicitly legacy if ( isJPA2 == null ) { @@ -1819,14 +1802,6 @@ public final class AnnotationBinder { ) }; } - else if ( property.isAnnotationPresent( org.hibernate.annotations.MapKeyManyToMany.class ) ) { - if ( isJPA2 == null ) { - isJPA2 = Boolean.FALSE; - } - joinKeyColumns = property.getAnnotation( org.hibernate.annotations.MapKeyManyToMany.class ) - .joinColumns(); - } - //not explicitly legacy if ( isJPA2 == null ) { isJPA2 = Boolean.TRUE; @@ -1876,9 +1851,7 @@ public final class AnnotationBinder { ); collectionBinder.setOneToMany( true ); } - else if ( elementCollectionAnn != null - || collectionOfElementsAnn != null //Hibernate legacy - ) { + else if ( elementCollectionAnn != null ) { for ( Ejb3JoinColumn column : joinColumns ) { if ( column.isSecondary() ) { throw new NotYetImplementedException( "Collections having FK in secondary table" ); @@ -1886,9 +1859,7 @@ public final class AnnotationBinder { } collectionBinder.setFkJoinColumns( joinColumns ); mappedBy = ""; - final Class targetElement = elementCollectionAnn != null ? - elementCollectionAnn.targetClass() : - collectionOfElementsAnn.targetElement(); + final Class targetElement = elementCollectionAnn.targetClass(); collectionBinder.setTargetEntity( mappings.getReflectionManager().toXClass( targetElement ) ); diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/ColumnsBuilder.java b/hibernate-core/src/main/java/org/hibernate/cfg/ColumnsBuilder.java index fdc2ca0576..292ec497f9 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/ColumnsBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/ColumnsBuilder.java @@ -32,7 +32,6 @@ import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.OneToOne; import org.hibernate.AnnotationException; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.annotations.Columns; import org.hibernate.annotations.Formula; import org.hibernate.annotations.JoinColumnsOrFormulas; @@ -112,7 +111,6 @@ class ColumnsBuilder { } else if ( joinColumns == null && ( property.isAnnotationPresent( OneToMany.class ) - || property.isAnnotationPresent( CollectionOfElements.class ) //legacy Hibernate || property.isAnnotationPresent( ElementCollection.class ) ) ) { OneToMany oneToMany = property.getAnnotation( OneToMany.class ); diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java index c5638a69a3..a4916f8518 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/CollectionBinder.java @@ -49,7 +49,6 @@ import org.hibernate.MappingException; import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CollectionId; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.Filter; import org.hibernate.annotations.FilterJoinTable; @@ -376,8 +375,7 @@ public abstract class CollectionBinder { collection.setRole(role); collection.setNodeName( propertyName ); - if ( (property.isAnnotationPresent( org.hibernate.annotations.MapKey.class ) - || property.isAnnotationPresent( MapKeyColumn.class ) ) + if ( property.isAnnotationPresent( MapKeyColumn.class ) && mapKeyPropertyName != null ) { throw new AnnotationException( "Cannot mix @javax.persistence.MapKey and @MapKeyColumn or @org.hibernate.annotations.MapKey " @@ -505,7 +503,6 @@ public abstract class CollectionBinder { tableBinder, mappings ); if ( collectionType.isAnnotationPresent( Embeddable.class ) - || property.isAnnotationPresent( CollectionOfElements.class ) //legacy hibernate || property.isAnnotationPresent( ElementCollection.class ) //JPA 2 ) { // do it right away, otherwise @ManyToOne on composite element call addSecondPass @@ -542,7 +539,6 @@ public abstract class CollectionBinder { Fetch fetch = property.getAnnotation( Fetch.class ); OneToMany oneToMany = property.getAnnotation( OneToMany.class ); ManyToMany manyToMany = property.getAnnotation( ManyToMany.class ); - CollectionOfElements collectionOfElements = property.getAnnotation( CollectionOfElements.class ); //legacy hibernate ElementCollection elementCollection = property.getAnnotation( ElementCollection.class ); //jpa 2 ManyToAny manyToAny = property.getAnnotation( ManyToAny.class ); FetchType fetchType; @@ -555,9 +551,6 @@ public abstract class CollectionBinder { else if ( elementCollection != null ) { fetchType = elementCollection.fetch(); } - else if ( collectionOfElements != null ) { - fetchType = collectionOfElements.fetch(); - } else if ( manyToAny != null ) { fetchType = FetchType.LAZY; } diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/MapBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/MapBinder.java index e275773d91..1d102dd364 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/MapBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/MapBinder.java @@ -33,8 +33,6 @@ import org.hibernate.AnnotationException; import org.hibernate.AssertionFailure; import org.hibernate.FetchMode; import org.hibernate.MappingException; -import org.hibernate.annotations.MapKey; -import org.hibernate.annotations.MapKeyManyToMany; import org.hibernate.annotations.MapKeyType; import org.hibernate.annotations.common.reflection.XClass; import org.hibernate.annotations.common.reflection.XProperty; @@ -159,12 +157,6 @@ public class MapBinder extends CollectionBinder { if ( property.isAnnotationPresent( MapKeyClass.class ) ) { target = property.getAnnotation( MapKeyClass.class ).value(); } - else if ( property.isAnnotationPresent( org.hibernate.annotations.MapKey.class ) ) { - target = property.getAnnotation( org.hibernate.annotations.MapKey.class ).targetElement(); - } - else if ( property.isAnnotationPresent( MapKeyManyToMany.class ) ) { - target = property.getAnnotation( MapKeyManyToMany.class ).targetEntity(); - } if ( !void.class.equals( target ) ) { mapKeyType = target.getName(); } @@ -281,19 +273,16 @@ public class MapBinder extends CollectionBinder { elementBinder.setColumns( elementColumns ); //do not call setType as it extract the type from @Type //the algorithm generally does not apply for map key anyway - MapKey mapKeyAnn = property.getAnnotation( org.hibernate.annotations.MapKey.class ); elementBinder.setKey(true); - if (mapKeyAnn != null && ! BinderHelper.isEmptyAnnotationValue( mapKeyAnn.type().type() ) ) { - elementBinder.setExplicitType( mapKeyAnn.type() ); + MapKeyType mapKeyTypeAnnotation = property.getAnnotation( MapKeyType.class ); + if ( mapKeyTypeAnnotation != null && !BinderHelper.isEmptyAnnotationValue( + mapKeyTypeAnnotation.value() + .type() + ) ) { + elementBinder.setExplicitType( mapKeyTypeAnnotation.value() ); } else { - MapKeyType mapKeyTypeAnnotation = property.getAnnotation( MapKeyType.class ); - if ( mapKeyTypeAnnotation != null && ! BinderHelper.isEmptyAnnotationValue( mapKeyTypeAnnotation.value().type() ) ) { - elementBinder.setExplicitType( mapKeyTypeAnnotation.value() ); - } - else { - elementBinder.setType( property, elementClass ); - } + elementBinder.setType( property, elementClass ); } mapValue.setIndex( elementBinder.make() ); } diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java index dc90390d0f..cacc42a683 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java @@ -120,7 +120,6 @@ import org.dom4j.Element; import org.hibernate.AnnotationException; import org.hibernate.internal.CoreMessageLogger; import org.hibernate.annotations.Cascade; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.annotations.Columns; import org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor; import org.hibernate.annotations.common.annotationfactory.AnnotationFactory; @@ -590,7 +589,6 @@ public class JPAOverridenAnnotationReader implements AnnotationReader { defaultToJoinTable = defaultToJoinTable && ( ( annotationClass == ManyToMany.class && StringHelper.isEmpty( ( (ManyToMany) annotation ).mappedBy() ) ) || ( annotationClass == OneToMany.class && StringHelper.isEmpty( ( (OneToMany) annotation ).mappedBy() ) ) - || ( annotationClass == CollectionOfElements.class ) //legacy Hibernate || ( annotationClass == ElementCollection.class ) ); final Class annotationType = JoinTable.class; @@ -794,40 +792,6 @@ public class JPAOverridenAnnotationReader implements AnnotationReader { annotation = getJavaAnnotation( CollectionTable.class ); addIfNotNull( annotationList, annotation ); } - else if ( isJavaAnnotationPresent( CollectionOfElements.class ) ) { //legacy Hibernate - annotation = overridesDefaultsInJoinTable( getJavaAnnotation( CollectionOfElements.class ), defaults ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( JoinColumn.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( JoinColumns.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( PrimaryKeyJoinColumn.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( PrimaryKeyJoinColumns.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( MapKey.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( OrderBy.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( AttributeOverride.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( AttributeOverrides.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( AssociationOverride.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( AssociationOverrides.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( Lob.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( Enumerated.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( Temporal.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( Column.class ); - addIfNotNull( annotationList, annotation ); - annotation = getJavaAnnotation( Columns.class ); - addIfNotNull( annotationList, annotation ); - } } } diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/any/PropertyMap.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/any/PropertyMap.java index 9d94dbd77c..552cb53fd4 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/any/PropertyMap.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/any/PropertyMap.java @@ -7,11 +7,11 @@ import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; +import javax.persistence.MapKeyColumn; import javax.persistence.Table; import org.hibernate.annotations.AnyMetaDef; import org.hibernate.annotations.Cascade; import org.hibernate.annotations.ManyToAny; -import org.hibernate.annotations.MapKey; import org.hibernate.annotations.MetaValue; @Entity @@ -59,7 +59,7 @@ public class PropertyMap { name = "map_properties", joinColumns = @JoinColumn( name = "map_id" ), inverseJoinColumns = @JoinColumn( name = "property_id" ) ) - @MapKey( columns = { @Column( name = "map_key", nullable = false ) } ) //keep for legacy test + @MapKeyColumn( name = "map_key", nullable = false ) //keep for legacy test public Map getProperties() { return properties; } diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/Boy.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/Boy.java index 73458f8639..2fc04de53e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/Boy.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/Boy.java @@ -19,7 +19,6 @@ import javax.persistence.JoinColumn; import javax.persistence.MapKeyColumn; import javax.persistence.OrderColumn; import javax.persistence.Table; -import org.hibernate.annotations.CollectionOfElements; /** * @author Emmanuel Bernard @@ -72,7 +71,7 @@ public class Boy { this.lastName = lastName; } - @CollectionOfElements //keep hibernate legacy for test purposes + @ElementCollection public Set getNickNames() { return nickNames; } @@ -136,8 +135,7 @@ public class Boy { public void setFavoriteNumbers(int[] favoriteNumbers) { this.favoriteNumbers = favoriteNumbers; } - - @CollectionOfElements //TODO migration to ElementCollection "element.serial"?? + @ElementCollection @AttributeOverride(name = "element.serial", column = @Column(name = "serial_nbr")) public Set getFavoriteToys() { return favoriteToys; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java index c87556ff16..faaeb0308e 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java @@ -252,7 +252,7 @@ public class CollectionElementTest extends BaseCoreFunctionalTestCase { public void testDefaultValueColumnForBasic() throws Exception { isDefaultValueCollectionColumnPresent( Boy.class.getName(), "hatedNames" ); isDefaultValueCollectionColumnPresent( Boy.class.getName(), "preferredNames" ); - isCollectionColumnPresent( Boy.class.getName(), "nickNames", "element" ); + isCollectionColumnPresent( Boy.class.getName(), "nickNames", "nickNames" ); isDefaultValueCollectionColumnPresent( Boy.class.getName(), "scorePerPreferredName"); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/indexedCollection/Sale.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/indexedCollection/Sale.java index 59ca1aec60..bc8e16481f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/indexedCollection/Sale.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/collectionelement/indexedCollection/Sale.java @@ -3,13 +3,13 @@ package org.hibernate.test.annotations.collectionelement.indexedCollection; import java.util.ArrayList; import java.util.List; import javax.persistence.Column; +import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import org.hibernate.annotations.CollectionId; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Type; @@ -20,8 +20,7 @@ import org.hibernate.annotations.Type; @GenericGenerator(name="increment", strategy = "increment") public class Sale { @Id @GeneratedValue private Integer id; - - @CollectionOfElements //TODO migrate to @ElementCollection, what about @CollectionId + @ElementCollection @JoinTable( name = "contact", joinColumns = @JoinColumn(name = "n_key_person")) diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embedded/EmbeddedTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/embedded/EmbeddedTest.java index 2f238d0d08..30e28d2b3f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embedded/EmbeddedTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/embedded/EmbeddedTest.java @@ -409,7 +409,7 @@ public class EmbeddedTest extends BaseCoreFunctionalTestCase { public void testDefaultCollectionTable() throws Exception { //are the tables correct? assertTrue( SchemaUtil.isTablePresent("WealthyPerson_vacationHomes", configuration() ) ); - assertTrue( SchemaUtil.isTablePresent("PersonEmbed_legacyVacationHomes", configuration() ) ); + assertTrue( SchemaUtil.isTablePresent("WealthyPerson_legacyVacationHomes", configuration() ) ); assertTrue( SchemaUtil.isTablePresent("WelPers_VacHomes", configuration() ) ); //just to make sure, use the mapping diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/embedded/WealthyPerson.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/embedded/WealthyPerson.java index 4a052cf91f..d859fe3911 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/embedded/WealthyPerson.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/embedded/WealthyPerson.java @@ -4,27 +4,17 @@ import java.util.Set; import javax.persistence.CollectionTable; import javax.persistence.ElementCollection; import javax.persistence.Entity; -import org.hibernate.annotations.CollectionOfElements; @Entity public class WealthyPerson extends Person { @ElementCollection -// @CollectionTable(name="XXXHOMES") -// @AttributeOverrides({ -// @AttributeOverride(name="address1", -// column=@Column(name="HOME_STREET")), -// @AttributeOverride(name="city", -// column=@Column(name="HOME_CITY")), -// @AttributeOverride(name="country", -// column=@Column(name="HOME_COUNTRY")) -// }) protected Set
vacationHomes = new HashSet
(); - @CollectionOfElements + @ElementCollection protected Set
legacyVacationHomes = new HashSet
(); - @CollectionOfElements + @ElementCollection @CollectionTable(name = "WelPers_VacHomes") protected Set
explicitVacationHomes = new HashSet
(); } diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/indexcoll/Atmosphere.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/indexcoll/Atmosphere.java index 7f147007a7..bbf5b001b2 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/indexcoll/Atmosphere.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/indexcoll/Atmosphere.java @@ -19,8 +19,6 @@ import javax.persistence.MapKeyJoinColumn; import javax.persistence.MapKeyJoinColumns; import javax.persistence.MapKeyTemporal; import javax.persistence.TemporalType; -import org.hibernate.annotations.CollectionOfElements; -import org.hibernate.annotations.MapKey; /** * @author Emmanuel Bernard @@ -56,7 +54,7 @@ public class Atmosphere { @JoinTable(name = "Gas_per_key") public Map gasesPerKey = new HashMap(); - @CollectionOfElements //TODO migrate to @ElementCollection ; @MapKeyManyToMany ?? + @ElementCollection @Column(name="composition_rate") @MapKeyJoinColumns( { @MapKeyJoinColumn(name="gas_id" ) } ) //use @MapKeyJoinColumns explicitly for tests @JoinTable(name = "Composition", joinColumns = @JoinColumn(name = "atmosphere_id")) @@ -70,7 +68,7 @@ public class Atmosphere { //use default HAN legacy column name for map key @ManyToMany(cascade = CascadeType.ALL) - @MapKey + @MapKeyColumn @JoinTable(name="Atm_Gas_DefLeg") public Map gasesDefLeg = new HashMap(); diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java index 19e54daa1a..180dc652e8 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/indexcoll/IndexedCollectionTest.java @@ -33,6 +33,7 @@ import java.util.Map; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.Transaction; +import org.hibernate.dialect.H2Dialect; import org.hibernate.dialect.HSQLDialect; import org.hibernate.mapping.Collection; import org.hibernate.mapping.Column; @@ -58,7 +59,7 @@ public class IndexedCollectionTest extends BaseCoreFunctionalTestCase { public void testJPA2DefaultMapColumns() throws Exception { isDefaultKeyColumnPresent( Atmosphere.class.getName(), "gasesDef", "_KEY" ); isDefaultKeyColumnPresent( Atmosphere.class.getName(), "gasesPerKeyDef", "_KEY" ); - isNotDefaultKeyColumnPresent( Atmosphere.class.getName(), "gasesDefLeg", "_KEY" ); + isDefaultKeyColumnPresent( Atmosphere.class.getName(), "gasesDefLeg", "_KEY" ); } @Test @@ -330,7 +331,7 @@ public class IndexedCollectionTest extends BaseCoreFunctionalTestCase { } @Test - @RequiresDialect(HSQLDialect.class) + @RequiresDialect({HSQLDialect.class, H2Dialect.class}) public void testComponentSubPropertyMapKey() throws Exception { Session s; Transaction tx; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/inheritance/singletable/Building.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/inheritance/singletable/Building.java index be117bd08e..e9597fda7c 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/inheritance/singletable/Building.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/inheritance/singletable/Building.java @@ -6,14 +6,12 @@ import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import org.hibernate.annotations.ForceDiscriminator; /** * @author Emmanuel Bernard */ @Entity @DiscriminatorColumn(name = "discriminator_disc") -@ForceDiscriminator @DiscriminatorValue("B") public class Building { @Id diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/override/PropertyRecord.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/override/PropertyRecord.java index 6fd8e7f86a..a0675e227b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/override/PropertyRecord.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/override/PropertyRecord.java @@ -9,7 +9,6 @@ import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import org.hibernate.annotations.CollectionOfElements; /** * @author Emmanuel Bernard @@ -29,12 +28,11 @@ public class PropertyRecord { public Map parcels; @AttributeOverrides({ - @AttributeOverride(name = "index.street", column = @Column(name = "STREET_NAME")), - @AttributeOverride(name = "element.size", column = @Column(name = "SQUARE_FEET")), - @AttributeOverride(name = "element.tax", column = @Column(name = "ASSESSMENT")) + @AttributeOverride(name = "key.street", column = @Column(name = "STREET_NAME")), + @AttributeOverride(name = "value.size", column = @Column(name = "SQUARE_FEET")), + @AttributeOverride(name = "value.tax", column = @Column(name = "ASSESSMENT")) }) - @CollectionOfElements - //@MapKey + @ElementCollection @CollectionTable(name="LegacyParcels") public Map legacyParcels; @@ -46,9 +44,9 @@ public class PropertyRecord { public Set unsortedParcels; @AttributeOverrides({ - @AttributeOverride(name = "element.size", column = @Column(name = "SQUARE_FEET")), - @AttributeOverride(name = "element.tax", column = @Column(name = "ASSESSMENT")) + @AttributeOverride(name = "size", column = @Column(name = "SQUARE_FEET")), + @AttributeOverride(name = "tax", column = @Column(name = "ASSESSMENT")) }) - @CollectionOfElements + @ElementCollection public Set legacyUnsortedParcels; } \ No newline at end of file diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/target/Brand.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/target/Brand.java index 63650d44ae..56fae22f23 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/target/Brand.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/target/Brand.java @@ -30,7 +30,7 @@ import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.MapKeyClass; -import org.hibernate.annotations.MapKeyManyToMany; +import javax.persistence.MapKeyJoinColumn; /** * @author Emmanuel Bernard @@ -47,7 +47,7 @@ public class Brand { @ElementCollection(targetClass = SizeImpl.class) @MapKeyClass(LuggageImpl.class) - @MapKeyManyToMany //legacy column name: was never officially supported BTW + @MapKeyJoinColumn private Map sizePerLuggage = new HashMap(); diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/EnumSetEntity.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/EnumSetEntity.java index 136461ffd2..b1994df4b4 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/EnumSetEntity.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/EnumSetEntity.java @@ -24,12 +24,12 @@ package org.hibernate.envers.test.entities.collection; import java.util.HashSet; import java.util.Set; +import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.envers.Audited; /** @@ -45,12 +45,12 @@ public class EnumSetEntity { private Integer id; @Audited - @CollectionOfElements + @ElementCollection @Enumerated(EnumType.STRING) private Set enums1; @Audited - @CollectionOfElements + @ElementCollection @Enumerated(EnumType.ORDINAL) private Set enums2; diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringListEntity.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringListEntity.java index ae7d4526ab..269ebf7450 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringListEntity.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringListEntity.java @@ -24,10 +24,10 @@ package org.hibernate.envers.test.entities.collection; import java.util.ArrayList; import java.util.List; +import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.annotations.IndexColumn; import org.hibernate.envers.Audited; @@ -41,7 +41,7 @@ public class StringListEntity { private Integer id; @Audited - @CollectionOfElements + @ElementCollection @IndexColumn(name = "list_index") private List strings; diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringMapEntity.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringMapEntity.java index 51a02715a8..dfd239ce9c 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringMapEntity.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringMapEntity.java @@ -24,10 +24,10 @@ package org.hibernate.envers.test.entities.collection; import java.util.HashMap; import java.util.Map; +import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.envers.Audited; /** @@ -40,7 +40,7 @@ public class StringMapEntity { private Integer id; @Audited - @CollectionOfElements + @ElementCollection private Map strings; public StringMapEntity() { diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringSetEntity.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringSetEntity.java index cca94e5fd8..a153e1825e 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringSetEntity.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/entities/collection/StringSetEntity.java @@ -24,10 +24,10 @@ package org.hibernate.envers.test.entities.collection; import java.util.HashSet; import java.util.Set; +import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.envers.Audited; /** @@ -40,7 +40,7 @@ public class StringSetEntity { private Integer id; @Audited - @CollectionOfElements + @ElementCollection private Set strings; public StringSetEntity() { diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/hashcode/WikiPage.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/hashcode/WikiPage.java index 183d0cef53..67cbb0fe5b 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/hashcode/WikiPage.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/hashcode/WikiPage.java @@ -2,11 +2,11 @@ package org.hibernate.envers.test.integration.hashcode; import java.util.HashSet; import java.util.Set; import javax.persistence.Basic; +import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.OneToMany; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.envers.Audited; /** @@ -25,7 +25,7 @@ public class WikiPage { @Basic private String content; - @CollectionOfElements + @ElementCollection private Set links = new HashSet(); @OneToMany diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapEntity.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapEntity.java index f154a10823..fe5250a10d 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapEntity.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/manytomany/ternary/TernaryMapEntity.java @@ -28,7 +28,6 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToMany; -import org.hibernate.annotations.MapKeyManyToMany; import org.hibernate.envers.Audited; import org.hibernate.envers.test.entities.IntTestEntity; import org.hibernate.envers.test.entities.StrTestEntity; @@ -44,7 +43,7 @@ public class TernaryMapEntity { @Audited @ManyToMany - @MapKeyManyToMany + @javax.persistence.MapKeyJoinColumn private Map map; public TernaryMapEntity() { diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableRangeTestEntitySuperClass.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableRangeTestEntitySuperClass.java index ca74784555..a93a901185 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableRangeTestEntitySuperClass.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/integration/naming/VersionsJoinTableRangeTestEntitySuperClass.java @@ -9,7 +9,6 @@ import javax.persistence.MappedSuperclass; * @author Erik-Berndt Scheper */ @MappedSuperclass -@org.hibernate.annotations.ForceDiscriminator @org.hibernate.envers.Audited public abstract class VersionsJoinTableRangeTestEntitySuperClass { diff --git a/hibernate-envers/src/test/java/org/hibernate/envers/test/performance/complex/ChildEntity2.java b/hibernate-envers/src/test/java/org/hibernate/envers/test/performance/complex/ChildEntity2.java index 4c0db160d6..c2e94a8d89 100644 --- a/hibernate-envers/src/test/java/org/hibernate/envers/test/performance/complex/ChildEntity2.java +++ b/hibernate-envers/src/test/java/org/hibernate/envers/test/performance/complex/ChildEntity2.java @@ -24,9 +24,9 @@ package org.hibernate.envers.test.performance.complex; import java.util.Set; +import javax.persistence.ElementCollection; import javax.persistence.Entity; import javax.persistence.Id; -import org.hibernate.annotations.CollectionOfElements; import org.hibernate.envers.Audited; /** @@ -42,7 +42,7 @@ public class ChildEntity2 { private Integer number; - @CollectionOfElements + @ElementCollection private Set strings; public Long getId() {