Re: Does Cayenne handle binary primary keys (Sybase) in relationships?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Oct 21 2003 - 12:58:55 EDT

  • Next message: Todd Costella: "Oracle Sequence Exception Question"

    Hi Michael,

    On Tuesday, October 21, 2003, at 12:44 PM, Michael Gentry wrote:

    > Hi, I'm trying to use Cayenne against a legacy Sybase model (current
    > system uses EOF, but has "additions" to it) that uses binary primary
    > keys (a 12-byte binary data type inside Sybase).

    Frankly I never tried using binary PK with Cayenne, but I don't see why
    this wouldn't work (I guess you may have to customize SybasePkGenerator
    if you want new ids created automatically).

    > Which seems fine so far. Then I try to follow the "number"
    > relationship to our "APNPoolNumber" entity and that's where it blows
    > apart with:
    >
    > java.lang.StringIndexOutOfBoundsException: String index out of range:
    > 268435450
    > at java.lang.String.charAt(String.java:460)

    That's an embarrassing bug ;-) You assessment of the fix seems right.
    I'll fix it tonight on 1.0.1 branch and make a patched version
    available for download.

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Oct 21 2003 - 12:58:55 EDT