Here's a list of some difference between subjects (excerpts from Hibernate documentation)
Entity. Hibernate goes beyond the JPA specification and provide additional configurations. Some of them are hosted on @org.hibernate.annotations.Entity
- dynamicInsert / dynamicUpdate (defaults to false)
- selectBeforeUpdate (defaults to false)
- polymorphisms
- persister
- optimisticLock (version, all, dirty, none)
id as a property using a component type
- While not supported in JPA, Hibernate lets you place your association directly in the embedded id component (instead of having to use the @MapsId annotation)
Multiple id properties without identifier type
- Another, arguably more natural, approach is to place @Id on multiple properties of your entity. This approach is only supported by Hibernate (not JPA compliant) but does not require an extra embeddable component.
Multiple id properties with with a dedicated identifier type
- While not JPA standard, Hibernate let's you declare the vanilla associated property in the @IdClass
Identifier generator
- Package level definition is not supported by the JPA specification. However, you can use the @GenericGenerator at the package level
Annotations
- Hibernate Annotations supports something that is not explicitly supported by the JPA specification. You can annotate a embedded object with the @MappedSuperclass annotation to make the superclass properties persistent (see @MappedSuperclass for more informations).
Discriminator
- @org.hibernate.annotations.DiscriminatorOptions allows to optionally specify Hibernate specific discriminator options which are not standardized in JPA. The available options are force and insert
Transaction
answered 2012-06-26T13:58:05.600