• 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
Problem with GUID to HEX conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with GUID to HEX conversion


  • Subject: Problem with GUID to HEX conversion
  • From: Fudik <email@hidden>
  • Date: Thu, 15 Nov 2007 09:02:30 -0500

I am using byte(24) binary keys in my mySql database and therefore,
using GUIDs for PK.  At some point in my program I need to constrict a
raw sql statement, so I need to convert EOGlobalID into String so that
SQL can use it.

So I used: primaryKeyForGlobalID to get the pkDict, then I extracted
the pk value and casted it to NSData. Then I used EOSQLExpression to
call sqlStringFromData.

Problem:
java.lang.ArrayIndexOutOfBoundsException: -4
at com.webobjects.foundation.NSData._hexString(NSData.java:805)

so to check for sure I have extracted the sample data from debugger
and constructed the following:

byte[] test = {0, 0, 10, 0, 1, -59, 0, 0, -83, -100, 23, 0, 0, 0, 1,
22, 57, 83, 83, -68, 79, 46, 74, 74};

NSData testData = new NSData(test);
String h = testData._hexString();

when I run this I get exactly the same error

I would like to confirm with anyone that I am doing this correctly,
since I think the problem is with _hexString().  I believe that it
expects only positive values of byte.  I have try replacing -59, -100
and -69 with positive numbers and this function works fine.

Thanks

-Vlad
 _______________________________________________
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: Problem with GUID to HEX conversion
      • From: Alexander Spohr <email@hidden>
  • Prev by Date: Re: Eclipse Version to Download
  • Next by Date: Re: Problem with GUID to HEX conversion
  • Previous by thread: Re: The Official What-I-Did-To-Run-5.3-On-Leopard Post
  • Next by thread: Re: Problem with GUID to HEX conversion
  • Index(es):
    • Date
    • Thread