Postgres adaptor

From: Dirk Olmes (dirk.olme..mx.de)
Date: Wed Feb 05 2003 - 22:21:40 EST

  • Next message: Andrus: "Re: Postgres adaptor"

    Hi,

    based on Holger's (and mine) negative success with MySQL I decided to
    give PostgreSQL a try as my favourite OpenSource database. So I started
    working on the postgres adaptor for cayenne.

    My current goal is to make the unit tests work with postgres. After
    fuzzing around with pk generation and constraints I'm now at a point
    where I find deficiencies in the testmap that's used for the unit tests.

    Postgresql is quite picky about date types. Other DBMSs don't usually
    have fine grained distinction between java.sql.Time (only stores hours,
    minutes and seconds), java.sql.Date (only stores days, months, years)
    and java.sql.Timestamp (stores both). IIRC, Oracle only has one DATE
    datatype and gracefully assumes default values when given an
    "incomplete" Date or Time object. I guess it's the same with sybase (not
    to talk about MySQL).

    Why am I writing all this stuff? Well, because to make things work with
    Postgresql we'll have to change the unit tests. The ARTIST DBEntity for
    example has a DATE_OF_BIRTH attribute, declared as TIME. I suppose this
    should really be a DATE instead. There's more of such examples, I can
    provide a full list if necessary....

    I tried to play around with different mappings e.g. map TIME to
    timestamp in the database etc. but still no success. The Unit Tests keep
    failing (I'm still looking into details).

    So I guess it comes down to the question if we'll fix the unit tests and
    who'll do it.

    Have a good night,

    -dirk



    This archive was generated by hypermail 2.0.0 : Wed Feb 05 2003 - 22:23:11 EST