• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
objectsMatchingKeyAndValue woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: objectsMatchingKeyAndValue woes
      • From: Miguel Arroz <email@hidden>
  • Prev by Date: Re: Re: Where does my JDBC Driver go
  • Next by Date: Re: objectsMatchingKeyAndValue woes
  • Previous by thread: EnhancedFileUploadTools package by Jonathan Rochkind,
  • Next by thread: Re: objectsMatchingKeyAndValue woes
  • Index(es):
    • Date
    • Thread