• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

Deprecated @Entity Annotation in Hibernate 4

December 25, 2013 //  by Krishna Srinivasan//  Leave a Comment

In the earlier versions of Hibernate, we use @Entity for marking a class as persistence entity in the database. It has list of attributes to be used as the parameters. @Entity has been deprecated from the hibernate 4 and will be removed from the hibernate 5.0 release. There is a confusion in the consistency of  information provided on their websites about the removal of these annotations. However, If you are using this annotation in the earlier versions of hibernate, you have to change before planning to migrate your project to higher versions. @Entity has the following list of attributes.

  1. dynamicInsert
  2. dynamicUpdate
  3. mutable
  4. optimisticLock
  5. persister
  6. polymorphism
  7. selectBeforeUpdate

When @Entity is removed, each and every attribute listed above will have its own annotation definition as listed below:

  1. DynamicInsert
  2. DynamicUpdate
  3. Immutable
  4. OptimisticLocking
  5. Persister
  6. Polymorphism
  7. SelectBeforeUpdate

However, the annotation Entity is deprecated in favor of the JPA annotation @javax.persistence.Entity. If you would like to use it, you have to use the JPA one instead of the hibernate annotation. It is obvious that there will be lot of changes with the hibernate API in the future versions, I would suggest to use the latest version if you are starting a new project.

Category: JavaTag: Deprecated, Hibernate 4 Tutorials

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Previous Post: « Hibernate Exception – javassist.util.proxy.MethodFilter
Next Post: How To Create Session Factory in Hibernate 4 »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

EJB 3.0 Timer Services

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact