Am Using Ebeans with Play2.0.2 I have two Models like this :
@Entity
@Table(name="GRP_MST")
public class GroupMst extends Model {
@Id
@Constraints.Required
@Formats.NonEmpty
public String groupid;
......
@OneToMany(cascade = CascadeType.ALL)
public List<DtlMenuGrp> dtlMenuGrpList; // This one is giving problems
}
And my DtlMenuGrp
Model looks like:
@Entity
@Table(name="DTL_MENU_GRP")
public class DtlMenuGrp extends Model {
@Constraints.Required
@Formats.NonEmpty
public String groupid;
....
}
I want to Join the above two Models so in My controller :
GroupMst groupMst = GroupMst.find.where().eq("groupid",data.get("grpid")).findUnique();
List<DtlMenuGrp> dtlMenuGrpList = groupMst.dtlMenuGrpList;
But this gives me below Excpetion of column not found :
Caused by: javax.persistence.PersistenceException: Query threw SQLException:Invalid column name 'group_mst_groupid'.
Bind values:[1000]
Query was:
select t0.groupid c0
, t1.groupid c1, t1.rightid c2, t1.status c3, t1.createdby c4, t1.createdon c5
from GRP_MST t0
left outer join DTL_MENU_GRP t1 on t1.group_mst_groupid = t0.groupid
where t0.groupid = ?
order by t0.groupid
Why does my column is casted as group_mst_groupid
instead of groupid