: 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
/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
--- 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
: 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
();
} 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
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
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
, 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
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
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
[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
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
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,
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
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,
15 matches
Mail list logo