• 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
Re: objectsMatchingKeyAndValue woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objectsMatchingKeyAndValue woes


  • Subject: Re: objectsMatchingKeyAndValue woes
  • From: Miguel Arroz <email@hidden>
  • Date: Sun, 17 Dec 2006 01:41:18 +0000

Hi!

  This is voodoo, but... what happens with:

NSArray Codes = EOUtilities.objectsMatchingKeyAndValue(ec, "Code", "code", code.toString());

  and

NSArray Codes = EOUtilities.objectsMatchingKeyAndValue(ec, "Code", "code", new String(code));

  ?

  :)

Could it be some kind of non-printable char in the string? Some space on the beginning or the end?

  Yours

Miguel Arroz

On 2006/12/17, at 00:06, Philippe Lafoucrière wrote:

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:
40guiamac.com


This email sent to email@hidden


"We have no sympathy for the lost souls
We've chosen the path of disgrace
We give this life to our children
And teach them to hate this place" -- Apocalyptica, Life Burns!

Miguel Arroz
http://www.ipragma.com


_______________________________________________ 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: Philippe Lafoucrière <email@hidden>
References: 
 >objectsMatchingKeyAndValue woes (From: Philippe Lafoucrière <email@hidden>)

  • Prev by Date: objectsMatchingKeyAndValue woes
  • Next by Date: Re: objectsMatchingKeyAndValue woes
  • Previous by thread: objectsMatchingKeyAndValue woes
  • Next by thread: Re: objectsMatchingKeyAndValue woes
  • Index(es):
    • Date
    • Thread