I'm relativly new to the world of EclipseLink, I've been reading through the documentation, however I'm having a real problem trying to represent the following table.
PTY_NO | REF_OBG
6544 45663
6544 1234
6544 97543
6544 1123
6544 77897
Ideally I'd like to represent the above data as follows.
@Entity
@Table(name="FCS_ISSR_OBG")
public class fcs_issr_obg implements Serializable {
@Id
@Column(name="PTY_NO")
private long pty_no;
@Column(name="REF_OBG")
private List<long> ref_obg;
...
As once I have the data in this form I plan to serialize the class into a Coherence cache.
However the annotation I've used doesn't actually compile ...
Any help would be gratefully received.
.. update
The best I've managed to come up with so far is
@Entity
@Table(name="FCS_ISSR_OBG")
public class fcs_issr_obg implements Serializable, PortableObject {
private static final long serialVersionUID = 1L;
@Id
@Column(name="PTY_NO")
private long pty_no;
@ElementCollection(targetClass = Long.class, fetch = EAGER)
@CollectionTable(
name = "FCS_ISSR_OBG",
joinColumns=@JoinColumn(name="PTY_NO")
)
@Column(name ="REF_OBG")
private List<Long> collection;
However this results in 2 queries ... which is not really what I'm after.
Cheers Rich