Hi,

Yes, I need to use this table on reporting applications that do not use OJB.
This fields must be readable.

Eric

-----Message d'origine-----
De : Thomas Dudziak [mailto:[EMAIL PROTECTED]
Envoye : vendredi 21 novembre 2003 17:39
A : OJB Users List
Objet : Re: Collection of string



~
On Fri, 21 Nov 2003, eric barbe wrote:

> Hi,
>
> I'm trying to map a string list declared as ArrayList in my Java code.
> I declared a collection like this
>
>   <class-descriptor ....>
>   ...
>     <collection-descriptor name="values"
> element-class-ref="java.lang.String" auto-update="true"
auto-retrieve="true"
> auto-delete="false">
>       <inverse-foreignkey field-ref="propvalues"/>
>     </collection-descriptor>
>   ...
>   </class-descriptor>
>
> I try to declare the class java.lang.String, it seems stupid, but i don't
> know how to do :
>
>   <class-descriptor class="java.lang.String" table="strings">
>     <field-descriptor name="ida" column="ida" jdbc-type="INTEGER"
> primarykey="true" autoincrement="true" access="anonymous"/>
>     <field-descriptor name="string" column="opt_string"
jdbc-type="VARCHAR"
> access="anonymous"/>
>     <field-descriptor name="propvalues" column="propvalues"
> jdbc-type="INTEGER" access="anonymous"/>
>   </class-descriptor>
>
> And my DDL script looks like the following
>   CREATE TABLE strings
>   (
>     ida INTEGER PRIMARY KEY
>     ,opt_string VARCHAR(255)
>     ,propvalues INTEGER
>     ,FOREIGN KEY (propvalues) REFERENCES properties(ida)
>   );
>
> Unfortunately nothing is mapped.
> If you understand my problem, can you give me a solution ?

Do you really need a table for the strings ? You could declare a field
(instead of a collection) for the string array using the CLOB, BLOB or
LONGVARBINARY type:

<field-descriptor
name="values"
jdbc-type="CLOB"
conversion="org.apache.ojb.broker.accesslayer.conversions.Object2ByteArrFiel
dConversion"
/>

Tom



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to