eclipselink « Composite « JPA Q&A





1. With Eclipselink/JPA, can I have a Foreign Composite Key that shares a field with a Primary Composite Key?    stackoverflow.com

My database has two entities; Company and Person. A Company can have many People, but a Person must have only one Company. The table structure looks as follows.

COMPANY
----------
owner   PK
comp_id ...

2. Limitation of JPA 1.0 using @IdClass with *nested* composite primary keys?    stackoverflow.com

Given the following example (departments - projects): A department has the following properties (composite primary key):

@Entity
@IdClass(DeptId.class)
public class Department
{
    @Id
    @Column(name="number")
    private Integer number;

 ...

3. JPA mapping issue with composite key    stackoverflow.com

I have a below mapping

@Entity
@Table(name = "auctions")
public class Auction{
.
.
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "auction")
    private List<AuctionParamValue> auctionParamValueList;
.
.
}


@Entity
@Table(name = "auction_param_values")
public class AuctionParamValue {

  ...

4. autoincrement id is not reflecting in composite key using JPA    stackoverflow.com

I have a below mapping

@Entity
@Table(name = "auctions")
public class Auction{
.
.
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "auction")
    private List<AuctionParamValue> auctionParamValueList;
.
.
}


@Entity
@Table(name = "auction_param_values")
public class AuctionParamValue {

  ...

5. Composite Primary Key Selection- What works with Hibernate doesnt work with EclipseLink. Why?    stackoverflow.com

I have two tables.

CREATE TABLE profile_table
( 
    profile_id NUMBER(10,0) PRIMARY KEY, 
    creator_manager_id NUMBER(10,0), 
    lastupdate DATE, 
    description ...

6. Composite Primary Key Not getting updated correctly with with EclipseLink. Where as with hibernate, it does. Why?    stackoverflow.com

I posted all the code and an issue with selection here. Now I am going to ask one more problem I have seen with eclipselink which I havent seen with hibernate. ...