JPA Relationship + Multi-Tenancy [message #726213] |
Fri, 16 September 2011 16:13  |
Eclipse User |
|
|
|
I'm not sure whether I've run into a bug with eclipse link's tenant discriminator or if I'm modeling my entities incorrectly.
Currently our database schema is setup to use relationship tables to model a relationship from one table to another, the table type indicates the type of relationship. If I execute a query on the entire table (Select e from Relationship e) it works. However if I try and query on any field within (Select e from Relationship e where e.id=123) eclipse link complains about the TENANT_ID parameter not being set (I've verified it has been set and this particular exception arrises on a per query basis).
Here's a code example of what the entities look like:
-------------------------------
@Entity
public class User {
... some fields
}
@Entity
public class Order {
...some fields
}
@Entity
public class UserOrderRelationship {
@Id
private long id;
@ManyToOne
@PrimaryKeyJoinColumn
private User user;
@ManyToOne
@PrimaryKeyJoinColumn
private Order order;
}
Any chance someone could point me in the right direction?
Thanks
|
|
|
|
Powered by
FUDForum. Page generated in 1.05741 seconds