Re: Enums as PK?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Apr 24 2008 - 10:19:55 EDT

  • Next message: Michael Gentry: "Re: [jira] Commented: (CAY-1041) Add release notes to downloads page."

    That's the thing - I opened that Jira as a note to self without doing
    immediate deeper investigation. So now I don't recall the exact
    details. :-)

    As for relationships, ideally it should work ... of course ... But
    since FK is not an ObjAttribute, it may get translated incorrectly
    when a related to-one fault ObjectId is instantiated. That would be a
    bug of course.

    Andrus

    On Apr 24, 2008, at 5:14 PM, Michael Gentry wrote:

    > I didn't try doing a relationship using the enum in the join. Did
    > you? I can try that, too, but I believe all of the translation code
    > goes through the same routines, so it should work there, too.
    >
    > Thanks,
    >
    > /dev/mrg
    >
    >
    > On Thu, Apr 24, 2008 at 10:11 AM, Andrus Adamchik
    > <andru..bjectstyle.org> wrote:
    >> Yeah, your example works in all combinations of M3/trunk and
    >> Extended enum
    >> vs. Java enum... I guess there was some other thing in my project
    >> (that I
    >> since remapped as String) that made it blow... I can think of two
    >> things -
    >> relationships and inheritance. I am pretty sure inheritance wasn't
    >> involved.
    >> So it was probably an issue similar to this:
    >>
    >> https://issues.apache.org/cayenne/browse/CAY-1034
    >>
    >> I guess we can close CAY-1014 and see if we can improve relationship
    >> validation...
    >>
    >> Andrus
    >>
    >>
    >>
    >>
    >> On Apr 24, 2008, at 4:35 PM, Michael Gentry wrote:
    >>
    >>> Hmm, I used the ExtendedEnumerations which aren't in M3. When I
    >>> changed my State class to look like:
    >>>
    >>> public enum State
    >>> {
    >>> AL, AK, AR, AZ, DC, MD, TN, VA;
    >>> }
    >>>
    >>> It still worked with M3.
    >>>
    >>>
    >>> On Thu, Apr 24, 2008 at 9:22 AM, Michael Gentry
    >>> <blacknex..mail.com>
    >> wrote:
    >>>
    >>>> Sorry, already sent the attachment. Nothing sensitive in it,
    >>>> though
    >>>> (custom test db/table).
    >>>>
    >>>> Let me see if I have M3 lying around and I'll try it.
    >>>>
    >>>> /dev/mrg
    >>>>
    >>>>
    >>>>
    >>>>
    >>>> On Thu, Apr 24, 2008 at 9:19 AM, Andrus Adamchik
    >> <andru..bjectstyle.org> wrote:
    >>>>
    >>>>> Sure, or you can attach it to CAY-1014 if you don't have any
    >>>>> sensitive
    >> info
    >>>>> in it.
    >>>>>
    >>>>> Wonder if my related fix had any effect on this? Could you try
    >>>>> it with
    >> M3
    >>>>> if possible?
    >>>>>
    >>>>> Thanks,
    >>>>> Andrus
    >>>>>
    >>>>>
    >>>>>
    >>>>> On Apr 24, 2008, at 4:16 PM, Michael Gentry wrote:
    >>>>>
    >>>>>
    >>>>>
    >>>>>> Andrus, I'm going to send you a test I just did via e-mail
    >>>>>> since the
    >>>>>> list doesn't support attachments. Enums as PKs worked for me.
    >>>>>> What
    >>>>>> issue were you seeing?
    >>>>>>
    >>>>>> Thanks,
    >>>>>>
    >>>>>> /dev/mrg
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>
    >>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Thu Apr 24 2008 - 10:20:28 EDT