Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>org.hibernate.annotations.Entity</code> has some extra attributes that <code>javax.persistence.Entity</code> has not standarized. The extra features will only work if using hibernate's <code>AnnotationConfiguration</code> directly or if hibernate is the JPA provider.</p> <p><strike> from <a href="https://www.hibernate.org/329.html" rel="noreferrer">the FAQ</a>: <strong>edit:</strong> new link <a href="https://community.jboss.org/wiki/HibernateFAQ-HibernateAnnotationsFAQ#I_use_orghibernateannotationsEntity_and_get_an_Unknown_entity_exception" rel="noreferrer">the specific question</a>: </strike> <strong>edit:</strong> new link <a href="https://developer.jboss.org/wiki/HibernateFAQ-HibernateAnnotationsFAQ#jive_content_id_I_use_orghibernateannotationsEntity_and_get_an_Unknown_entity_exception" rel="noreferrer">the answer</a>:</p> <blockquote> <p><strong>I use @org.hibernate.annotations.Entity and get an Unknown entity exception</strong></p> <p>Always import @javax.persistence.Entity</p> <p>@org.hibernate.annotations.Entity completes @javax.persistence.Entity but is not a replacement</p> </blockquote> <p>For instance, there is an attribute called <code>optimisticLock</code>, which tells hibernate whether to use the standard <em>version column</em> or to compare all columns when updating. This behavior is not in the JPA spec, so in order to configure it, you must use hibernate specific extension found in their own annotation.</p> <p>Like this:</p> <pre><code>@Entity @org.hibernate.annotations.Entity(optimisticLock=OptimisticLockType.ALL) public class MyEntity implements Serializable { ... } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload