javahibernate

Change the default IdentifierGenerator in Hibernate


how may I change the default IdentifierGenerator in Hibernate.

I know i can specify an IdentifierGenerator for a Table with Annotations/hibernate.cfg.xml, but i dont like to specify it for every single Table.

Thanks


Solution

  • The thing you need is to configure the identifier generation at sessionfactory level. This feature is not supported in Hibernate.sessionFactory Configurations, mapping declarations You have to specify it for every table.