Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-11-24 Thread piltrafeta
: piltrafeta [EMAIL PROTECTED]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=1520608i=1 Subject: Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key To: [EMAIL PROTECTED]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=1520608i=2 Date: Wednesday, November 19, 2008, 9:38 AM Hi Fay

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-11-20 Thread piltrafeta
/08, piltrafeta [EMAIL PROTECTED]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=1520608i=0 wrote: From: piltrafeta [EMAIL PROTECTED]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=1520608i=1 Subject: Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key To: [EMAIL

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-11-19 Thread piltrafeta
--- On Tue, 11/18/08, piltrafeta [EMAIL PROTECTED] wrote: From: piltrafeta [EMAIL PROTECTED] Subject: Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key To: users@openjpa.apache.org Date: Tuesday, November 18, 2008, 11:56 AM Hi! I'm having a similar problem for a while, maybe you

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-11-19 Thread Fay Wang
: piltrafeta [EMAIL PROTECTED] Subject: Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key To: users@openjpa.apache.org Date: Wednesday, November 19, 2008, 9:38 AM Hi Fay, I've done the modification you told me but it's still not working... when i insert new registers the pactId from

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-11-18 Thread piltrafeta
(); } catch (Exception e){ e.printStackTrace(); } } } --- On Tue, 6/17/08, Enrico Goosen [EMAIL PROTECTED] wrote: From: Enrico Goosen [EMAIL PROTECTED] Subject: Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key To: users@openjpa.apache.org Date: Tuesday

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key BUG

2008-07-16 Thread hfridland
Hi, I have same problem. I have 2 tables on Sybase Anywhere: @Entity public class Employee { @Id @GeneratedValue private Long Id; private String name; ... } @Entity @IdClass(EmpHourId.class) public class EmpHour { @Id private Long empId; @Id private

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-06-17 Thread Enrico Goosen
Hi Fay, I tried out your suggestion: @ManyToOne(fetch = FetchType.LAZY,cascade=CascadeType.MERGE) @JoinColumn(name = XYZ_ID,referencedColumnName=SCMPDT_ID) private TblScmpdt tblScmpdt; But unfortunately, still no luck. Got this exception: openjpa-1.1.0-r422266:657916 fatal store error

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-06-17 Thread Fay Wang
, Enrico Goosen [EMAIL PROTECTED] wrote: From: Enrico Goosen [EMAIL PROTECTED] Subject: Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key To: users@openjpa.apache.org Date: Tuesday, June 17, 2008, 1:32 AM Hi Fay, I tried out your suggestion: @ManyToOne(fetch = FetchType.LAZY,cascade

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-06-16 Thread Jeremy Bauer
Hi Enrico. Do you have an embedded id or id class defined for TblPdtbnf? Section 2.1.4 of the JPA spec says the following regarding composite primary keys: specA composite primary key must correspond to either a single persistent field or property or to a set of such fields or properties as

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-06-16 Thread Fay Wang
ok. I can reproduce your problem. Let me take a look. -f --- On Sat, 6/14/08, Enrico Goosen [EMAIL PROTECTED] wrote: From: Enrico Goosen [EMAIL PROTECTED] Subject: Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key To: users@openjpa.apache.org Date: Saturday, June 14, 2008, 5:46 AM

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-06-16 Thread Fay Wang
[EMAIL PROTECTED] Subject: Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key To: users@openjpa.apache.org Date: Saturday, June 14, 2008, 5:46 AM Hi Fay, The primary key for TblScmpdt is database generated. Here's the mapping: @TableGenerator(name=baseGenerator,schema=EBSTATUS,table

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-06-14 Thread Enrico Goosen
Hi Fay, The primary key for TblScmpdt is database generated. Here's the mapping: @TableGenerator(name=baseGenerator,schema=EBSTATUS,table=TBL_KEYGEN,pkColumnName=PRIMARY_KEY_COLUMN ,valueColumnName=LAST_USED_ID,pkColumnValue=TBL_SCMPDT_ID,allocationSize=100) @Id

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key BUG

2008-06-13 Thread Enrico Goosen
This is clearly a bug in OpenJPA, because the IdClass' field is not getting sychronized with the Entities Id field. In this case, TblPdtbnf.scmpdtId is not getting copied to TblPdtbnfPK.scmpdtId. Hence this error: Attempt to set column TBL_PDTBNF.SCMPDT_ID to two different values: (null)null,

@OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-06-12 Thread Enrico Goosen
I can't get cascading persist working on my entities which have the following mappings. TblScmpdt.java //Parent @OneToMany(fetch = FetchType.LAZY,mappedBy=tblScmpdt,cascade={CascadeType.MERGE,CascadeType.REMOVE}) private CollectionTblPdtbnf tblPdtbnfs = new ArrayListTblPdtbnf(); TblPdtbnf.java

Re: @OneToMany/@ManyToOne, Bidirectional, Composite Key

2008-06-12 Thread Enrico Goosen
I commented out the @Id fields in: TblPdtbnf.java and added: @EmbeddedId private TblPdtbnfPK tblPdtbnfPK; Now I get this exception, which seems more promising, but still no cigar. Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: DB2 SQL error: SQLCODE: -530, SQLSTATE: 23503,