Hi,
I am using composite key for a field and now while searching for list (when result count is more than one) my query is getting formed incorrectly(issue in object binding in in clause).
For example I have a class A
with composite key having Long id1; and Long id2.
I tried with both two way string and field bridge
Query is being formed is like
Code:
select ...from A where ((this_.id1, this_.id2) in ( (1, 1), (1110, 1111)))
Now both 1 are id 2 and 1110 and 1111 are id1
for single result it works fine....
my twowaystring bridge is simly
Code:
public String objectToString(Object value)
{
AId id = (AId) object;
StringBuilder sb = new StringBuilder();
sb.append( id.getid1())
.append( "-" )
.append( id.getId2());
return sb.toString();
}
public Object stringToObject(String strValue)
{
split and then set id1 and id2 then return AId;
}
It is working fine even for the case when Aid comes as association for some other entity.
Only in case of direct fetch for this entity I am facing issues.
Any clues?
Regards,
Suresh