Hi Dariusz,

Dariusz Kies wrote:
Could I map one attribute in my class to many fields in a table? For example I
Yes, that's possible. You must use the PersistentFieldNestedField implementation (to be configured in OJB.properties).

The FieldDescriptors for Price (inside the Article ClassDescriptor!) could look like follows:


have a class:

class Price
{
double value; String currency;
}

and my persistent class:

class Article
{
long id;
String name;
Price price;
}

and my repository.xml:

<class-descriptor
class="Article"
table="T_Article"
>
<field-descriptor id="1"
name="id"
column="id"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"
/>
<field-descriptor id="2"
name="name"
column="name"
jdbc-type="VARCHAR"
/>

       <field-descriptor id="3"
          name="price->value"
          column="price_value"
          jdbc-type="DOUBLE"
       />
       <field-descriptor id="4"
          name="price->currency"
          column="price_currency"
          jdbc-type="VARCHAR"
       />


<!-- How can I declare my price attribute ??? -->

</class-descriptor>

I don't want to do a table with prices and I don't want to split my Price class
into two attributes in the Article class.
thanks in advance
Dariusz Kies

cheers,
Thomas

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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






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

Reply via email to