Alex Rivera | Logout

similarity and difference between jpa and hibernate

Asked 2009-11-20T12:39:50.580
16

what is similarity and difference between jpa and hibernate.

Edit
Report

1 Answer

1

Here's a list of some difference between subjects (excerpts from Hibernate documentation)

  1. 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)
  2. 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)
  3. 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.
  4. 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
  5. Identifier generator

    • Package level definition is not supported by the JPA specification. However, you can use the @GenericGenerator at the package level
  6. 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).
  7. 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
  8. Transaction

    • Hi
answered 2012-06-26T13:58:05.600

Your Answer