• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generator Type

 
Ankita Jha
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,
We use the below mentioned tag to generate id
<id name="abc" column="ABC">
<generator class=""></generator>
</id>

I want my to generate number which is a combination of Finyear+and running serial number eg .200080001
Which Generator class do i use to generate number of the above mentioned form.

Thanks in advance.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to use your own custom generator if you want to use logic like this.
 
Vijay Gadde
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I havent tried in my application, but I had tried to pull out an example. May be below example might help you.

Thanks,VijayGadde
 
Ankita Jha
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not able to get any valuable information for the link posted in the reply.
it would be helpful if ny one can provide me with a sample application or..step by step implementation og custom id generators
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The hibernate documentation contains an example of a Custom generator.

Also, Hibernate is open source, so you could always look at the code behind the out the box generators.
[ November 12, 2008: Message edited by: Paul Sturrock ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic