Quantcast
Viewing all articles
Browse latest Browse all 3131

How to have two entities for one table in Eclipse Link?

Hi All,

I am new to Eclipse Link. I wanted to have two entities for one table and I want to insert data into the table.

For example:

 

Entity 1:

 

@Entity

@Table(name = "myTable")

public class myEntity1 {

id;

commonField;

 

}

 

 

Entity 2:

 

@Entity

@Table(name = "myTable")

public class myEntity2 {

idEntity;

commonField;  

 

}

 

Please note "commonField" is common to both entities.

Please guide.


Viewing all articles
Browse latest Browse all 3131

Trending Articles