Re: Hook in the cayenne internals

From: Tore Halset (halse..vv.ntnu.no)
Date: Mon Apr 02 2007 - 09:09:54 EDT

  • Next message: Michael Gentry: "Re: Hook in the cayenne internals"

    On Apr 2, 2007, at 15:05, jerome moliere wrote:

    > 2007/4/2, Tore Halset <halse..vv.ntnu.no>:
    >>
    >>
    >> On Apr 2, 2007, at 11:02, jerome moliere wrote:
    >>
    >> > CREATE TABLE PAITINGS_TBL(painting_id int primary key,painting_data
    >> > bytea);
    >> >
    >> > CREATE TABLE ARTISTS_BIO(artist_id int primary key, artist_text_bio
    >> > bytea);
    >> >
    >> >
    >> > in this schema 2 tables with 2 BLOB fields, the first one is simply
    >> > the JPEG
    >> > while the second is a long text with all the artist bio...
    >> >
    >> > The extendedtype could permit me to change the Cayenne behavior but
    >> > for all
    >> > bytea fields isn't it ?
    >>
    >> No. You can map painting_data to Image and create an ExtendedType to
    >> handle Image. Your artist_text_bio should perhaps be of type text
    >> instead of bytea?
    >
    >
    >
    > hi tore,
    > your no sounds to be a yes isn't it ?

    You create a ExtendedType for the java side (Image or whatever) of
    the mapping, not the database-side (bytea). So you can have one bytea
    mapped to Image and another to Map<String> and create two
    ExtendedTypes to handle the encoding/decoding.

      - Tore.



    This archive was generated by hypermail 2.0.0 : Mon Apr 02 2007 - 09:11:00 EDT