Hi Vincent!
You get something similiar if you make the address also a CMP bean. Then
User.Address will store the reference to the address bean. (And yes, I
can hear a lot of people screaming right now, that this is not the way
EJBs should be used. But a lot of people do :-) ).
But probably thats not the way you want it. Just to make sure I
understand what you are looking for:
The address object is dependant on the User object. At the moment such
an object just gets serialized and stored as a BLOBs (like I pointed out
earlier). You would like JAWS to map the properties of a dependant
object like the property of the "master" object itself. This should
theoretically be possible since there is only 0 or 1 object stored in
the reference. I think at the moment JAWS is not capable of doing this.
I want do dive into the JAWS code myself in the future since I need
support for arrays. Maybe I could add this. What about you ? Do you have
some spare time ?
Greetings,
Tobias
Vincent Harcq wrote:
>
> Tobias,
> I am the same process now and have a related question.
> I looked in the jbosstest and zola but did not find any examples.
>
> If I have a Entity Bean User with properties
> public String firstName;
> public String lastName;
> public Address address;
>
> With an Address "JavaBean" (private attributes, get/set methods) : line1,
> line2, city, country ALL String.
>
> I have a table USER with FIELD FIRSTNAME, LASTNAME, LINE1, LINE2, CITY and
> COUNTRY.
>
> firstName and latsName will be maped automatically. OK.
>
> Is not possible to define a special jaws.xml that will map automatically the
> Address'fields to my database using something like
> <ejb-name>User</ejb-name>
> <table-name>USER</table-name>
> <cmp-field>
> <field-name>address.line1</field-name>
> <column-name>LINE1</column-name>
> <jdbc-type>VARCHAR</jdbc-type>
> <sql-type>VARCHAR(256)</sql-type>
> </cmp-field>
>
> etc ...
>
> I think WxxxLxxC do that. (do not take that as a critic or anything
> similar, just a remark)
>
> I have ONE table so that would be a great feature to have in CMP 1.1.
>
> Vincent.
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]