objectsMatchingKeyAndValue woes
objectsMatchingKeyAndValue woes
- Subject: objectsMatchingKeyAndValue woes
- From: Philippe Lafoucrière <email@hidden>
- Date: Sun, 17 Dec 2006 01:06:21 +0100
Hello,
this problem is driving me crazy :
I want to fetch a simple entity, using a functionnal key "code".
Here's a simple example :
public Boolean codeIsValid() {
EOEditingContext ec = ((Session)session()).defaultEditingContext();
try {
NSArray Codes = EOUtilities.objectsMatchingKeyAndValue(ec, "Code",
"code", code);
return !Codes.isEmpty();
} catch (EOObjectNotAvailableException e) {
// TODO: handle exception
return false;
}
}
My entity "Code" is a simple entity, with a column code_id (pk) and
code (varchar255).
The example above is not working with the variable code (a String) =
"123456789".
If I replace the object code with "123456789" (as it) :
NSArray Codes = EOUtilities.objectsMatchingKeyAndValue(ec, "Code",
"code", "123245689");
it works !!
I've tried :
- code.toString() -> NOK
- new String(code) -> NOK
- replace objectsMatchingKeyAndValue with objectMatchingKeyAndValue -
> NOK
With all debug output, the query looks like :
SELECT t0.code, t0.codeId, t0.toValidation FROM Code t0 WHERE t0.code
= "12345678"
which is working on mysql.
Please help
Philippe
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden