-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Application level ID generator
PostPosted: Tue Jul 08, 2014 3:42 am 
Newbie

Joined: Tue Oct 03, 2006 2:07 am
Posts: 18
Hello!
I think want simple thing, but I google hours and nothing.

I don't want define @GeneratedValue(strategy = GenerationType.TABLE) or @org.hibernate.annotations.GenericGenerator(..) on every single entity.

I want define application wide strategy, so only @GeneratedValue can be used.

Is it uncommon? I don't thing so.


Help very appreciated.


Top
 Profile  
 
 Post subject: Re: Application level ID generator
PostPosted: Tue Jul 08, 2014 12:40 pm 
Newbie

Joined: Tue Oct 03, 2006 2:07 am
Posts: 18
Hibernate folks .. thanks to reverse engineering this is solution

hibernate.id.new_generator_mappings=true
hibernate.ejb.identifier_generator_strategy_provider=cz.marbes.boot.hibernate.MyOwnIdentifierGeneratorStrategyProvider

Now you have application wide IdentifierGeneratorStrategy and simple @GeneratedValue can be used everywhere.

Hooray!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.