[jboss-user] [EJB 3.0] - Re: CascadeType.PERSIST question

ttrepper do-not-reply at jboss.com
Mon Sep 10 12:58:55 EDT 2007


Thank you very much for your answer - but I think your suggestion will not work, because the Entity PartyIsPerson extends the Entity Party, which has a generated key like this:
	@Id
  | 	@SequenceGenerator(name="party_id", sequenceName="seq_partyid")
  | 	@GeneratedValue(generator="party_id", strategy=GenerationType.SEQUENCE)
  | 	public long getPartyId() {
  | 		return this.partyid;
  | 	}

Therefore when I insert the person, I do not know the key. And therefore i think, that i cannot do the suggested following line 
  | phc.setPartyidperson(p.getPartyId());

Do you know, what i mean?
Any ideas?

Thanks a lot and kind regards,

Thomas

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

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



More information about the jboss-user mailing list