SELECT DISTINCT p
FROM Player p, IN(p.teams) t
Data retrieved: All players who belong to a team.
Description: The FROM clause declares two identification variables: p and t. The p variable represents the Player entity, and the t variable represents the related Team entity. The declaration for t references the previously declared p variable. The IN keyword signifies that teams is a collection of related entities. The p.teams expression navigates from a Player to its related Team. The period in the p.teams expression is the navigation operator.
Questions:
1. Please show me the structure & data examples for two tables Player and Team? and what the results?
2. why teams? not team?
Thank you in advance!
Reference:
http://java.sun.com/javaee/5/docs/tutorial/doc/bnbtl.html