-->
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.  [ 1 post ] 
Author Message
 Post subject: IdentifierGenerator in an Interceptor for composed key
PostPosted: Fri Jul 20, 2007 7:41 am 
Newbie

Joined: Wed Jun 13, 2007 2:50 am
Posts: 2
Hi,

I have a problem with a composed-id.
I have a table "Translation" that has a composed primary key (idTranslation, idLocale), where idLocale is a FK to the PK of table Locale.
So, the following data
(1,"en","Die Hard")
(1,"es","La Jungla de Cristal")
means that both Strings are different translations of the same movie title.

Now, the value for column idTranslation should be auto-generated when new titles are added, and assigned when a new translation of an existing title is added.

So, I wrote an Interceptor and overridden the onSave() method. Inside there, I want to call some Hibernate implementation for generating the next idTranslation. The question is, how?

I tried to use IdentifierGeneratorFactory, but it takes some parameters I don't have inside onSave(). The same for IdentifierGenerator.

Any help?

Thanks,

Mariano.


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

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.