Dear Objectdb-Team
I have some Problems running a criteria query against a set. But maybe I misunderstood some essentials
I have defined an entity class and an embeddable class like this
@Entity
class Container {
@ElementCollection(fetch = FetchType.EAGER)
List<Testclass> testlist1 = new LinkedList<Testclass>();
@ElementCollection(fetch = FetchType.EAGER)
List<String> testlist2 = new LinkedList<String>();
Testclass testobject = new Testclass(0,0);
}
@Embeddable
class Testclass {
long uid = 0;
long udb = 0;
}
Im unable to search for some occurence of Objects of Testclass in Container (equal and hash methods in Testclass are implemented). My problem is, that
CriteriaBuilder cb = ...
Root<Container> root = ...
Testclass searchobject = new Testclass(1,2);
Predicate predicate = cb.isMember(searchobject,root.<Collection<Testclass>>get("testlist1"));
doesn't work, while
String searchobject = "testtext";
Predicate predicate = cb.isMember(searchobject,root.<Collection<String>>get("testlist2"));
works as expected.
the equal-query
Testclass searchobject = new Testclass(1,2);
Predicate predicate = cb.equal(a_root.<Testclass>get("testobject"), searchobject);
works as expected.
Even the cb.in(..) method works as expected. Is this a problem of objectdb or does the isMember(..) Method could not be used on user defined classes or does i missed some extra configuration.