From 3b3487a74eace3f0a1d3db31132870eb5d108b9a Mon Sep 17 00:00:00 2001 From: Gavin King Date: Thu, 25 Feb 2021 11:22:43 +0100 Subject: [PATCH] remove deprecated @Entity annotation --- .../userguide/appendices/Annotations.adoc | 5 -- .../org/hibernate/annotations/Entity.java | 69 ------------------- .../org/hibernate/cfg/AnnotationBinder.java | 8 --- .../cfg/annotations/EntityBinder.java | 49 +++---------- .../hibernate/internal/CoreMessageLogger.java | 10 --- .../annotations/embedded/one2many/Alias.java | 2 +- .../binding/annotations/access/xml/Boy.java | 2 +- .../orm/test/jpa/cascade/Conference.java | 5 +- .../test/jpa/cascade/ExtractionDocument.java | 5 +- .../jpa/cascade/ExtractionDocumentInfo.java | 6 +- .../derivedidentities/MedicalHistory.java | 2 +- .../test/annotations/entity/Forest.java | 14 ++-- .../test/annotations/entity/Forest2.java | 2 +- .../test/annotations/entity/ZipCode.java | 3 +- .../test/annotations/persister/Card.java | 4 +- .../test/annotations/persister/Deck.java | 1 - .../test/annotations/polymorphism/Car.java | 3 +- .../annotations/polymorphism/SportCar.java | 3 +- 18 files changed, 42 insertions(+), 151 deletions(-) delete mode 100644 hibernate-core/src/main/java/org/hibernate/annotations/Entity.java diff --git a/documentation/src/main/asciidoc/userguide/appendices/Annotations.adoc b/documentation/src/main/asciidoc/userguide/appendices/Annotations.adoc index 531cc97c70..c5a69b3145 100644 --- a/documentation/src/main/asciidoc/userguide/appendices/Annotations.adoc +++ b/documentation/src/main/asciidoc/userguide/appendices/Annotations.adoc @@ -773,11 +773,6 @@ See the <> annotation as well. ==== -[[annotations-hibernate-entity]] -==== [line-through]#`@Entity`# - -The https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/annotations/Entity.html[[line-through]#`@Entity`#] annotation is deprecated. Use the JPA <> annotation instead. - [[annotations-hibernate-fetch]] ==== `@Fetch` diff --git a/hibernate-core/src/main/java/org/hibernate/annotations/Entity.java b/hibernate-core/src/main/java/org/hibernate/annotations/Entity.java deleted file mode 100644 index 900eee7309..0000000000 --- a/hibernate-core/src/main/java/org/hibernate/annotations/Entity.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * License: GNU Lesser General Public License (LGPL), version 2.1 or later. - * See the lgpl.txt file in the root directory or . - */ -package org.hibernate.annotations; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -/** - * Extends {@link javax.persistence.Entity} with Hibernate features. - * - * @author Emmanuel Bernard - * - * @deprecated See individual attributes for intended replacements. To be removed in 4.1 - */ -@Target(TYPE) -@Retention(RUNTIME) -@Deprecated -public @interface Entity { - /** - * Is this entity mutable (read only) or not. - * - * @deprecated use {@link org.hibernate.annotations.Immutable} - */ - @Deprecated - boolean mutable() default true; - /** - * Needed column only in SQL on insert. - * @deprecated use {@link DynamicInsert} instead - */ - @Deprecated - boolean dynamicInsert() default false; - /** - * Needed column only in SQL on update. - * @deprecated Use {@link DynamicUpdate} instead - */ - @Deprecated - boolean dynamicUpdate() default false; - /** - * Do a select to retrieve the entity before any potential update. - * @deprecated Use {@link SelectBeforeUpdate} instead - */ - @Deprecated - boolean selectBeforeUpdate() default false; - /** - * polymorphism strategy for this entity. - * @deprecated use {@link Polymorphism} instead - */ - @Deprecated - PolymorphismType polymorphism() default PolymorphismType.IMPLICIT; - /** - * optimistic locking strategy. - * @deprecated use {@link OptimisticLocking} instead. - */ - @Deprecated - OptimisticLockType optimisticLock() default OptimisticLockType.VERSION; - /** - * persister of this entity, default is hibernate internal one. - * @deprecated use {@link Persister} instead - */ - @Deprecated - String persister() default ""; -} 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 41a1b685d4..f97f8ab750 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/AnnotationBinder.java @@ -605,12 +605,8 @@ public final class AnnotationBinder { PersistentClass persistentClass = makePersistentClass( inheritanceState, superEntity, context ); Entity entityAnn = clazzToProcess.getAnnotation( Entity.class ); - org.hibernate.annotations.Entity hibEntityAnn = clazzToProcess.getAnnotation( - org.hibernate.annotations.Entity.class - ); EntityBinder entityBinder = new EntityBinder( entityAnn, - hibEntityAnn, clazzToProcess, persistentClass, context @@ -1346,10 +1342,6 @@ public final class AnnotationBinder { || AnnotatedClassType.NONE.equals( classType ) //to be ignored || AnnotatedClassType.EMBEDDABLE.equals( classType ) //allow embeddable element declaration ) { - if ( AnnotatedClassType.NONE.equals( classType ) - && clazzToProcess.isAnnotationPresent( org.hibernate.annotations.Entity.class ) ) { - LOG.missingEntityAnnotation( clazzToProcess.getName() ); - } return false; } diff --git a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java index 254c466eec..1741055174 100644 --- a/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/cfg/annotations/EntityBinder.java @@ -117,7 +117,6 @@ public class EntityBinder { private Boolean insertableDiscriminator; private boolean dynamicInsert; private boolean dynamicUpdate; - private boolean explicitHibernateEntityAnnotation; private OptimisticLockType optimisticLockType; private PolymorphismType polymorphismType; private boolean selectBeforeUpdate; @@ -154,7 +153,6 @@ public class EntityBinder { public EntityBinder( Entity ejb3Ann, - org.hibernate.annotations.Entity hibAnn, XClass annotatedClass, PersistentClass persistentClass, MetadataBuildingContext context) { @@ -162,7 +160,7 @@ public class EntityBinder { this.persistentClass = persistentClass; this.annotatedClass = annotatedClass; bindEjb3Annotation( ejb3Ann ); - bindHibernateAnnotation( hibAnn ); + bindHibernateAnnotation(); } /** @@ -184,47 +182,41 @@ public class EntityBinder { } @SuppressWarnings("SimplifiableConditionalExpression") - private void bindHibernateAnnotation(org.hibernate.annotations.Entity hibAnn) { + private void bindHibernateAnnotation() { { final DynamicInsert dynamicInsertAnn = annotatedClass.getAnnotation( DynamicInsert.class ); this.dynamicInsert = dynamicInsertAnn == null - ? ( hibAnn == null ? false : hibAnn.dynamicInsert() ) + ? false : dynamicInsertAnn.value(); } { final DynamicUpdate dynamicUpdateAnn = annotatedClass.getAnnotation( DynamicUpdate.class ); this.dynamicUpdate = dynamicUpdateAnn == null - ? ( hibAnn == null ? false : hibAnn.dynamicUpdate() ) + ? false : dynamicUpdateAnn.value(); } { final SelectBeforeUpdate selectBeforeUpdateAnn = annotatedClass.getAnnotation( SelectBeforeUpdate.class ); this.selectBeforeUpdate = selectBeforeUpdateAnn == null - ? ( hibAnn == null ? false : hibAnn.selectBeforeUpdate() ) + ? false : selectBeforeUpdateAnn.value(); } { final OptimisticLocking optimisticLockingAnn = annotatedClass.getAnnotation( OptimisticLocking.class ); this.optimisticLockType = optimisticLockingAnn == null - ? ( hibAnn == null ? OptimisticLockType.VERSION : hibAnn.optimisticLock() ) + ? OptimisticLockType.VERSION : optimisticLockingAnn.type(); } { final Polymorphism polymorphismAnn = annotatedClass.getAnnotation( Polymorphism.class ); this.polymorphismType = polymorphismAnn == null - ? ( hibAnn == null ? PolymorphismType.IMPLICIT : hibAnn.polymorphism() ) + ? PolymorphismType.IMPLICIT : polymorphismAnn.type(); } - - if ( hibAnn != null ) { - // used later in bind for logging - explicitHibernateEntityAnnotation = true; - //persister handled in bind - } } private void bindEjb3Annotation(Entity ejb3Ann) { @@ -276,13 +268,7 @@ public class EntityBinder { if ( annotatedClass.isAnnotationPresent( Immutable.class ) ) { mutable = false; } - else { - org.hibernate.annotations.Entity entityAnn = - annotatedClass.getAnnotation( org.hibernate.annotations.Entity.class ); - if ( entityAnn != null ) { - mutable = entityAnn.mutable(); - } - } + rootClass.setMutable( mutable ); rootClass.setExplicitPolymorphism( isExplicitPolymorphism( polymorphismType ) ); @@ -309,9 +295,6 @@ public class EntityBinder { } } else { - if (explicitHibernateEntityAnnotation) { - LOG.entityAnnotationOnNonRoot(annotatedClass.getName()); - } if (annotatedClass.isAnnotationPresent(Immutable.class)) { LOG.immutableAnnotationOnNonRoot(annotatedClass.getName()); } @@ -324,22 +307,8 @@ public class EntityBinder { //set persister if needed Persister persisterAnn = annotatedClass.getAnnotation( Persister.class ); - Class persister = null; if ( persisterAnn != null ) { - persister = persisterAnn.impl(); - } - else { - org.hibernate.annotations.Entity entityAnn = annotatedClass.getAnnotation( org.hibernate.annotations.Entity.class ); - if ( entityAnn != null && !BinderHelper.isEmptyAnnotationValue( entityAnn.persister() ) ) { - try { - persister = context.getBootstrapContext().getClassLoaderAccess().classForName( entityAnn.persister() ); - } - catch (ClassLoadingException e) { - throw new AnnotationException( "Could not find persister class: " + entityAnn.persister(), e ); - } - } - } - if ( persister != null ) { + Class persister = persisterAnn.impl(); persistentClass.setEntityPersisterClass( persister ); } diff --git a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java index eeb011f9b3..dd6c17b703 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java @@ -233,10 +233,6 @@ public interface CoreMessageLogger extends BasicLogger { @Message(value = "Entities updated: %s", id = 80) void entitiesUpdated(long entityUpdateCount); - @LogMessage(level = WARN) - @Message(value = "@org.hibernate.annotations.Entity used on a non root entity: ignored for %s", id = 81) - void entityAnnotationOnNonRoot(String className); - @LogMessage(level = WARN) @Message(value = "Entity Manager closed by someone else (%s must not be used)", id = 82) void entityManagerClosedBySomeoneElse(String autoCloseSession); @@ -511,12 +507,6 @@ public interface CoreMessageLogger extends BasicLogger { int anticipatedNumberOfArguments, int numberOfArguments); - @LogMessage(level = WARN) - @Message(value = "Class annotated @org.hibernate.annotations.Entity but not javax.persistence.Entity (most likely a user error): %s", - id = 175) - void missingEntityAnnotation(String className); - - @LogMessage(level = ERROR) @Message(value = "Error in named query: %s", id = 177) void namedQueryError( diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embedded/one2many/Alias.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embedded/one2many/Alias.java index 91d2c8ec09..9ee7660884 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embedded/one2many/Alias.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/embedded/one2many/Alias.java @@ -8,7 +8,7 @@ package org.hibernate.orm.test.annotations.embedded.one2many; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import org.hibernate.annotations.Entity; +import javax.persistence.Entity; /** * TODO : javadoc diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/access/xml/Boy.java b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/access/xml/Boy.java index 1b89f51f24..498977d1b1 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/access/xml/Boy.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/bootstrap/binding/annotations/access/xml/Boy.java @@ -12,7 +12,7 @@ import java.util.Set; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import org.hibernate.annotations.Entity; +import javax.persistence.Entity; /** * @author Hardy Ferentschik diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/Conference.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/Conference.java index 7077d2aab1..da6d1d88d8 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/Conference.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/Conference.java @@ -7,6 +7,9 @@ //$Id$ package org.hibernate.orm.test.jpa.cascade; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + import java.io.Serializable; import java.util.Date; import javax.persistence.CascadeType; @@ -30,7 +33,7 @@ import javax.persistence.Table; @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.CHAR) @DiscriminatorValue("X") -@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true) +@DynamicUpdate @DynamicInsert public class Conference implements Serializable { private Long id; private Date date; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/ExtractionDocument.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/ExtractionDocument.java index 4183ca9399..dd2a0e2a5e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/ExtractionDocument.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/ExtractionDocument.java @@ -17,6 +17,8 @@ import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.Proxy; /** @@ -24,8 +26,7 @@ import org.hibernate.annotations.Proxy; */ @Entity @Table(name = "portal_pk_docs_extraction") -//@Cache(usage = READ_WRITE) -@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true) +@DynamicUpdate @DynamicInsert @Proxy public class ExtractionDocument implements Serializable { private Long id; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/ExtractionDocumentInfo.java b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/ExtractionDocumentInfo.java index b8aa1503b5..ff5faea51f 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/ExtractionDocumentInfo.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/jpa/cascade/ExtractionDocumentInfo.java @@ -7,6 +7,9 @@ //$Id$ package org.hibernate.orm.test.jpa.cascade; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; + import java.io.Serializable; import java.util.ArrayList; import java.util.Date; @@ -29,8 +32,7 @@ import javax.persistence.Transient; */ @Entity @Table(name = "portal_pk_docs_extraction_info") -//@Cache(usage = READ_WRITE) -@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true) +@DynamicUpdate @DynamicInsert public class ExtractionDocumentInfo implements Serializable { private Long id; private Date lastModified; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/derivedidentities/MedicalHistory.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/derivedidentities/MedicalHistory.java index b856cd1667..88fe0a4c88 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/derivedidentities/MedicalHistory.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/derivedidentities/MedicalHistory.java @@ -13,7 +13,7 @@ import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.OneToOne; -import org.hibernate.annotations.Entity; +import javax.persistence.Entity; /** * @author Hardy Ferentschik diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/Forest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/Forest.java index 104cf87b52..9591224d1b 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/Forest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/Forest.java @@ -16,14 +16,19 @@ import javax.persistence.Id; import javax.persistence.Lob; import org.hibernate.annotations.BatchSize; +import org.hibernate.annotations.DynamicInsert; +import org.hibernate.annotations.DynamicUpdate; import org.hibernate.annotations.Filter; import org.hibernate.annotations.FilterDef; import org.hibernate.annotations.Index; import org.hibernate.annotations.OptimisticLock; import org.hibernate.annotations.OptimisticLockType; +import org.hibernate.annotations.OptimisticLocking; import org.hibernate.annotations.ParamDef; import org.hibernate.annotations.Parameter; +import org.hibernate.annotations.Polymorphism; import org.hibernate.annotations.PolymorphismType; +import org.hibernate.annotations.SelectBeforeUpdate; import org.hibernate.annotations.Type; import org.hibernate.annotations.Where; @@ -34,11 +39,10 @@ import org.hibernate.annotations.Where; */ @Entity @BatchSize(size = 5) -@org.hibernate.annotations.Entity( - selectBeforeUpdate = true, - dynamicInsert = true, dynamicUpdate = true, - optimisticLock = OptimisticLockType.ALL, - polymorphism = PolymorphismType.EXPLICIT) +@SelectBeforeUpdate +@DynamicInsert @DynamicUpdate +@OptimisticLocking(type = OptimisticLockType.ALL) +@Polymorphism(type = PolymorphismType.EXPLICIT) @Where(clause = "1=1") @FilterDef(name = "minLength", parameters = {@ParamDef(name = "minLength", type = "integer")}) @Filter(name = "betweenLength") diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/Forest2.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/Forest2.java index e4fac4430f..21e43eb493 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/Forest2.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/Forest2.java @@ -22,7 +22,7 @@ import org.hibernate.annotations.Type; /** * Mapping following lines of {@link Forest}, but using the replacements for the now deprecated - * {@link org.hibernate.annotations.Entity} annotation. + * {@link javax.persistence.Entity} annotation. * * @author Steve Ebersole */ diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/ZipCode.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/ZipCode.java index 8700376837..bf12d1deff 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/ZipCode.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/entity/ZipCode.java @@ -12,13 +12,14 @@ import javax.persistence.Id; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import org.hibernate.annotations.Immutable; /** * @author Emmanuel Bernard */ @Cache(usage = CacheConcurrencyStrategy.READ_ONLY) @Entity -@org.hibernate.annotations.Entity(mutable = false) +@Immutable public class ZipCode { @Id public String code; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/persister/Card.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/persister/Card.java index adfce8ba43..30320adf45 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/persister/Card.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/persister/Card.java @@ -5,6 +5,8 @@ * See the lgpl.txt file in the root directory or . */ package org.hibernate.test.annotations.persister; +import org.hibernate.annotations.Persister; + import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.Id; @@ -15,7 +17,7 @@ import javax.persistence.ManyToOne; * @author Shawn Clowater */ @Entity -@org.hibernate.annotations.Entity( persister = "org.hibernate.persister.entity.SingleTableEntityPersister" ) +@Persister( impl = org.hibernate.persister.entity.SingleTableEntityPersister.class ) public class Card implements Serializable { @Id public Integer id; diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/persister/Deck.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/persister/Deck.java index 3a49e4f116..0ba5545ede 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/persister/Deck.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/persister/Deck.java @@ -18,7 +18,6 @@ import org.hibernate.annotations.Persister; * @author Shawn Clowater */ @Entity -@org.hibernate.annotations.Entity( persister = "org.hibernate.persister.entity.SingleTableEntityPersister" ) @Persister( impl = org.hibernate.test.annotations.persister.EntityPersister.class ) public class Deck implements Serializable { @Id diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/polymorphism/Car.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/polymorphism/Car.java index b210ba750c..6bc772fb0f 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/polymorphism/Car.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/polymorphism/Car.java @@ -15,6 +15,7 @@ import javax.persistence.InheritanceType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; +import org.hibernate.annotations.Polymorphism; import org.hibernate.annotations.PolymorphismType; /** @@ -22,7 +23,7 @@ import org.hibernate.annotations.PolymorphismType; */ @Entity @Inheritance(strategy= InheritanceType.TABLE_PER_CLASS) -@org.hibernate.annotations.Entity(polymorphism = PolymorphismType.EXPLICIT) +@Polymorphism(type = PolymorphismType.EXPLICIT) public class Car extends Automobile { @Id diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/polymorphism/SportCar.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/polymorphism/SportCar.java index ac8e27e6a3..a0c8deb716 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/polymorphism/SportCar.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/polymorphism/SportCar.java @@ -10,6 +10,7 @@ package org.hibernate.test.annotations.polymorphism; import javax.persistence.Entity; import javax.persistence.Table; +import org.hibernate.annotations.Polymorphism; import org.hibernate.annotations.PolymorphismType; /** @@ -17,6 +18,6 @@ import org.hibernate.annotations.PolymorphismType; */ @Entity @Table(name = "sport_car") -@org.hibernate.annotations.Entity(polymorphism = PolymorphismType.EXPLICIT) //raise a warn +@Polymorphism(type = PolymorphismType.EXPLICIT) //raise a warn public class SportCar extends Car { }