Consider the following JPA entity. My application instance class must always have a OneToOne reference to 4 special instances of Envelope but it also has a set of 0-infinite user defined envelopes. Is this even possible? Is it possible with both Unidirectional and/or Bidirectional references?
@Entity(name = "Application_Instance")
public class ApplicationInstance implements Serializable {
@Id
private int databaseId;
private Envelope accountTransfersEnvelope = new Envelope("Account Transfers");
@OneToOne
private Envelope newTransationsEnvelope = new Envelope("New Transactions");
@OneToOne
private Envelope incomeEnvelope = new Envelope("Income Envelope");
@OneToOne
private Envelope creditCarEnvelope= new Envelope("Credit Card");
@OneToMany
protected Set<Envelope> userEnvelopes = new HashSet<Envelope>();
//rest of class
}