cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tore Halset <hal...@pvv.ntnu.no>
Subject Re: Hook in the cayenne internals
Date Mon, 02 Apr 2007 13:09:54 GMT

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

> 2007/4/2, Tore Halset <halset@pvv.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.



Mime
View raw message