Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPA Relationship + Multi-Tenancy
JPA Relationship + Multi-Tenancy [message #726218] Fri, 16 September 2011 20:13 Go to next message
Jonathan is currently offline JonathanFriend
Messages: 8
Registered: July 2009
Junior Member
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
Re: JPA Relationship + Multi-Tenancy [message #730514 is a reply to message #726218] Wed, 28 September 2011 14:32 Go to previous message
Guy Pelletier is currently offline Guy PelletierFriend
Messages: 19
Registered: July 2009
Junior Member
Can you post the exception? And the code you are executing that results in the exception being thrown?

Where is your TENANT_ID set?

Also, you may want to try the latest 2.3.1 nightly.

http://www.eclipse.org/eclipselink/downloads/nightly.php
Previous Topic:JPA Relationship + Multi-Tenancy
Next Topic:(no subject)
Goto Forum:
  


Current Time: Mon Dec 22 20:12:37 GMT 2014

Powered by FUDForum. Page generated in 0.01442 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software