Re: reverse engineering of id to what type?

From: Q (qdola..mail.com)
Date: Sat Nov 22 2008 - 16:47:18 EST

  • Next message: Xavier Destombes: "Re: Maclipse 3.4.1"

    I believe much of the type mapping is dependant on the jdbc metadata
    that is returned by the driver. You could try a different version of
    the jdbc driver and see if that makes any difference. Be aware however
    that mysql supports non standard unsigned variants of its numeric
    types so this behaviour may turn out to be intentional.

    On 23/11/2008, at 5:43 AM, Ray Kiddy wrote:

    >
    > 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
    >

    -- 
    Seeya...Q
    

    Quinton Dolan - qdola..mail.com Gold Coast, QLD, Australia (GMT+10) Ph: +61 419 729 806



    This archive was generated by hypermail 2.0.0 : Sat Nov 22 2008 - 16:48:11 EST