❮ Previous Next ❯

Hibernate Generator Classes

The hibernate generator classes implements hibernate.id. IdentifierGenerator interface, and over ride the generate method to generate the identifier or primary key value.

< generator > is one of main element in the mapping file of hibernate framework. The sub element of id used to generate the unique identifier for the objects of persistent class.

While saving an object into the database, the generator informs to the hibernate that, how the primary key value for the new record is going to generate.

Hibernate use different primary key generator algorithms, for each algorithm internally a class is created by hibernate for its implementation. There are many generator classes defined in the Hibernate Framework.

If we want our own user defined generator, then we should implement IdentiferGenerator interface and override the generate().

All the generator classes implements the org.hibernate.id.IdentifierGenerator . Hibernate framework provides many built-in generator classes:

  1. assigned
  2. increment
  3. sequence
  4. hilo
  5. native
  6. identity
  7. seqhilo
  8. uuid
  9. guid
  10. select
  11. foreign
  12. sequence-identity

❮ Previous Next ❯

Follow Us





  Tutorials

Popular Links

Contact Us

address Plot No-741,2ND Floor
Opp. Bhagabati Temple,Jayadev Vihar
      Bhubaneswar-751013
      Email: info@silantechnology.com
      Phone: 0674-2361252
address
39877, sundale dr, apt#101, Fremont, California 94538, USA
       Phone: +1(262)388-7619

facebook twitter google linked in

© 2018 Silan Technology. All Rights Reserved