You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Helo,
Thanks for the very useful hibernate generic DAO, your code is.
I'm getting a little problem working on nested attributes and collection of
mapped objects.
=== Classses ===
public class User implements Serializable {
@Id
private long id;
@ManyToMany(fetch = LAZY)
@JoinTable(
name="user_group_user",
schema="users",
joinColumns = @JoinColumn(
name="userId",
referencedColumnName = "id"),
inverseJoinColumns = @JoinColumn(
name="groupId",
referencedColumnName = "id")
)
@OrderBy
Set<UserGroup> groups;
}
public class ServiceRequest implements {
@ManyToOne
@JoinColumn(name="assignedUserId", referencedColumnName = "id")
@Fetch(FetchMode.JOIN)
private User assignedUser;
}
==================
This code is working fine:
Search s = new Search();
List<Long> uids = new ArrayList<Long>();
uids.add(1l);
uids.add(2l);
s.addFilterIn("assignedUser.id", uids);
This code is not working
Search s = new Search();
List<UserGroup> groups = new ArrayList<UserGroup>();
groups.add(new UserGroup(1));
groups.add(new UserGroup(2));
s.addFilterIn("assignedUser.groups", groups);
Error:
Caused by: java.lang.IllegalArgumentException: Property path
'assignedUser.groups' invalid for type com.sarbarian.itsm.entity.ServiceRequest
at com.trg.search.jpa.JPAAnnotationMetadataUtil.get(JPAAnnotationMetadataUtil.java:24)
at com.trg.search.BaseSearchProcessor.prepareValue(BaseSearchProcessor.java:707)
at com.trg.search.BaseSearchProcessor.filterToQL(BaseSearchProcessor.java:451)
at com.trg.search.BaseSearchProcessor.generateWhereClause(BaseSearchProcessor.java:413)
at com.trg.search.BaseSearchProcessor.generateQL(BaseSearchProcessor.java:111)
at com.trg.search.jpa.JPASearchProcessor.search(JPASearchProcessor.java:88)
Question: What should do I do?
Thanks !!
Davi.
Original issue reported on code.google.com by [email protected] on 8 Oct 2010 at 6:23
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 8 Oct 2010 at 6:23The text was updated successfully, but these errors were encountered: