reverse engineering of id to what type?

From: Ray Kiddy (ra..anymede.org)
Date: Sat Nov 22 2008 - 14:43:20 EST

  • Next message: Jeremy Matthews: "Re: Nightly => Stable?"

    I see something and I think it may be incorrect, but I wanted to
    check with the list.

    I can create a table in MySQL like this:

            create table Thing (id int primary key, name varchar(64));

    If I then reverse-engineer that table into an EOModel in a 'Wonder
    Application', I get an entity that has an attribute named "id", but
    its external type is "java.lang.Long" and its valueType is "l".

    I expected a java.lang.Integer and I usually end up fixing these
    myself, or later on I add some foreign key and I get a run-time
    exception because Long != Integer. Of course, the exception message
    is a very friendly "this might not be a big thing, but you want to
    fix this", but it is inconvenient.

    If I wanted a java.lang.Long, I would have used a "longint" in the
    column definition. Perhaps some databases do not have two types of
    integers, but most do. Could the smart thing happen for database that
    have different kinds of integer types? There could be some default
    behavior (as exists now) for databases that only have one integer type.

    So, am I wrong? Is this a bug or do people think that I should always
    be getting a java.lang.Long?

    cheers - ray



    This archive was generated by hypermail 2.0.0 : Sat Nov 22 2008 - 14:44:40 EST