Problem with GUID to HEX conversion
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