Recently i had to use an outer join between two JPA entities that doesnt have object relational mapping. Going by the spec and the forum posts, outer joins are supported only if the entities are mapped at JPA level.
Example code below. Requirement is to find customers without any orders.
@Entity
class Customer {
private int id;
}
@Entity
class Order {
private int customerId;
public int getCustomerId() { return customerId; }
public void setCustomerId(int customerId) { this.customerId = customerId ; }
}
In my case, i had to opt for the native queries to get the job done.
Any thoughts on if future JPA specs going to support outer joins without relational mapping ?
Thanks Rakesh