db-ojb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mahler <t...@apache.org>
Subject Re: Mapping complex data types
Date Thu, 05 Dec 2002 07:17:28 GMT
Hi Uwe,

Hoell. Uwe wrote:
> Is it possible to have an complex type for an field (or any fields) and map
> the fields of the complex type as separat columns to the database-table?
> 
> Public Class A {
> 	public String a1;
> 	public B b1;
> 	public B b2;
> ... }
> 
> Public class B {
> 	public String b1;
> 	public String b2;
> ... }
> 
> Class A should then be mapped to a table like:
> tableA(a1, b1b1, b1b2, b2b1, b2b2, ...)
> 

Yes that is possible! It can be done with the NestedPersistentFieldImpl.

> 
> If it's possible, what's about foreign keys for fields in class B, and can I
> have nested complex types (means class B has an attribut of type class (or
> an interface?) C...)
> 

Yes should be possible too. You can use normal FieldDescriptor elements 
and use the foolowing syntax to describe the nested attributes:
<field-descriptor
     name="b1->b1b1"
     ...
/>

Uwe: If I can help you with your evaluation directly just let me know.
You may post your questions in german, which may things simpler for both 
of us ;-)

cheers,
Thomas


> 
> 
> Thanks,
> 
> Uwe Hoell
> --
> AEB GmbH, www.aeb.de
> D-70597 Stuttgart, Julius-Hölder-Str. 39
> Tel. +49/711/7 28 42-268, Fax -333, hoell@aeb.de
> 
> --
> To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ojb-user-help@jakarta.apache.org>
> 
> 
> 
> 




Mime
View raw message