Open GoogleCodeExporter opened 8 years ago
Try this:
Search s = new Search();
List<UserGroup> groups = new ArrayList<UserGroup>();
groups.add(new UserGroup(1));
groups.add(new UserGroup(2));
s.addFilterSome("assignedUser.groups", Filter.in("", groups));
Because groups is a collection, the normal filters do not work. You have to use
SOME, ALL, or NONE filters to operate on collections.
Original comment by dwolvert
on 9 Oct 2010 at 3:04
Hi, thanks for your reply:
I've tried it and I've got the same:
Search(class com.sarbarian.itsm.entity.ServiceRequest)[first: -1, page: -1,
max: -1] {
resultMode: AUTO,
disjunction: false,
fields: { },
filters: {
some `assignedUser.groups` {`` in (ArrayList {com.sarbarian.user.entity.UserGroup@16af3e6, com.sarbarian.user.entity.UserGroup@16af3e6})}
},
sorts: { }
}
16:59:38,859 ERROR [[Resteasy]] Servlet.service() for servlet Resteasy threw
exception
org.jboss.resteasy.spi.UnhandledException: javax.ejb.EJBException:
java.lang.IllegalArgumentException: Property path 'assignedUser.groups' invalid
for type com.sarbarian.itsm.entity.ServiceRequest
Original comment by bal...@gmail.com
on 9 Oct 2010 at 8:02
Oh, you're using JPA (I should have noticed). Are you using Hibernate's JPA
implementation? If not, JPA mappings are only partially supported. But that
still might not be the problem. First see what EQL is really getting spit out.
Set your logging for the category "com.trg.search.jpa.JPASearchProcessor" to
DEBUG, and check your log to see if the query is messed up. Please paste the
result here as well. I'm curious to see what's going on.
Another thing to consider is that if you're using JPA 2, you can probably write
write and implementation of MetadataUtil in a couple of days based using the
JPA metadata API. That would make the framework fully compatible with any JPA2
implementation. It would be an extremely useful thing to contribute back to the
project, and it should solve your problem.
Original comment by dwolvert
on 12 Oct 2010 at 2:37
Hi,
I've created the category but I'm not sure if this is what you want. The only
entry was:
2010-10-13 07:43:13,203 DEBUG [com.trg.search.jpa.JPASearchProcessor]
(http-192.168.192.124-8080-2) p1: 1
Unfortunately, I'm using JPA 1. However, I could contribute debugging and
revising the current implementation for the project. I just would like to know
wich classes should I have a look or should I take care of.
Cheers, Davi.
Original comment by bal...@gmail.com
on 13 Oct 2010 at 11:03
Oops I forgot to finish what I intended to put in the comment. Also add DEBUG
for "com.trg.search.BaseSearchProcessor". This logging is found here:
http://code.google.com/p/hibernate-generic-dao/wiki/Logging. I just added it,
but forgot to put it all my comment to you.
Original comment by dwolvert
on 13 Oct 2010 at 11:15
Hi, not working yet.
2010-10-14 13:40:21,375 DEBUG [com.trg.search.BaseSearchProcessor]
(http-192.168.192.124-8080-1) generateQL:
select _it from com.sarbarian.crm.entity.Site _it where _it.company.id = :p1
2010-10-14 13:40:21,375 DEBUG [com.trg.search.jpa.JPASearchProcessor]
(http-192.168.192.124-8080-1) p1: 1
However the query present here isn't the marformed query. I'll try to debug the
code in order to find something and I'll post my findings here.
Cheers,
Davi
Original comment by bal...@gmail.com
on 14 Oct 2010 at 4:43
Is this relevant anymore?
Original comment by pablit...@gmail.com
on 14 Jun 2014 at 7:03
Original issue reported on code.google.com by
bal...@gmail.com
on 8 Oct 2010 at 6:23