On Mar 4, 2008, at 6:36 PM, Razumovsky Andrey wrote:
Hi Andrus,
AA> to find objects by FK you can match against a relationship target
AA> object ObjectId:
AA>
AA> ExpressionFactory.matchExp("relationshipName", new
AA> ObjectId("TargetEntity", "pk", 2);
AA>
Thanks, this is exactly what i need. However, it doesn't work on
client (i mean manual checking by match()).
The reason is in ASTEqual, where one object (o1) is Persistent, and
the other one (o2) is ObjectId. So straight checking currently
implemented here (i mean o1.equals(o2)) isn't correct.
In my local Cayenne i just check for objects class (if it's
Persistent then .getObjecId() should be used). Maybe you more
complicated fix must be done here. I can open bug issue if you wish.
Ok, for in-memory matching, yeah, things work a bit differently and I
think we need to fix it. A bug report is appreciated.
By the way, i assume you're from Belarus? So i can email you
directly in Russian?)
As for Cayenne support questions, I'd prefer them to stay on the list.
That's the only way we can scale the support and keep the community
together. Otherwise, yeah, I am from Minsk and I do speak Russian :-)
Andrus