[jboss-user] [JBoss Seam] - Re: EntityHome and Primay Key value assignment for new recor

terryb do-not-reply at jboss.com
Wed Oct 10 12:36:08 EDT 2007


I found my mistake, I wasn't using the right instance.

the following fixed the problem 1.

@Override
public String persist() {
 if (Strings.isNull(getInstance().getId()) && !this.isManaged()) {
 KeyGenerator keyGen = (KeyGenerator) Component.getInstance (KeyGenerator.class, true);
 getInstance().setId(keyGen.getKey(Constant.Database.KeySuffix.ADMIN));
 } 
 return super.persist();
}


Any clue to my question 2 will be appreciated.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093605#4093605

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093605



More information about the jboss-user mailing list