Note that there are some explanatory texts on larger screens.

plurals
  1. POJPA @ManyToOne fields are empty
    text
    copied!<p>I have spent hours looking how to solve this. When I try to get parent from a child all but it's id fields are empty. It just makes no sense. I am using PlayFramework 2.0.4 if that might indicate anything (besides a terrible choice of framework).</p> <p>TRoute.java (parent)</p> <pre><code>@Entity @Table(name="routes") public class TRoute extends Model { @Id public String route_id; public String agency_id; @Constraints.Required public String route_short_name; @Constraints.Required public String route_long_name; public String route_desc; @Constraints.Required public String route_type; public String route_url; public String route_color; public String route_text_color; @OneToMany(mappedBy="troute") public List&lt;Trip&gt; trips; public static Finder&lt;String, TRoute&gt; find = new Finder( String.class, TRoute.class ); } </code></pre> <p>Trip.java (child)</p> <pre><code>@Entity @Table(name="trips") public class Trip extends Model { @Constraints.Required public String route_id; @Constraints.Required public String service_id; @Id public String trip_id; public String trip_headsign; public String direction_id; public String block_id; public String shape_id; @ManyToOne @JoinColumn(name="route_id") public TRoute troute; public static List&lt;Trip&gt; byRouteId(String route_id) { List&lt;Trip&gt; trips = Trip.find .where().like("route_id", route_id) .findList(); return trips; } public static Finder&lt;String, Trip&gt; find = new Finder( String.class, Trip.class ); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload