Hi Tobias!
Yes I want to do an extensive usage of dependant object in Entity
beans.
I want an Address, a Quantity, an Amount, a Currency, etc...
I do not want to stop me to do object oriented design.
And I also want that these objects be "readable" by direct database
query to use Catalog/DAO when I have performance problems, or other
tools that are not Java based. So Serialization is bad for me.
I think that is called "dependant object" in EJB 2.0.
But as you mention it must be possible to do it with existing JAWS.
I am in jBoss since 2.0 so I do not pretend to enter the code in 2
hours. I will see what I can do.
BTW, the dev list is more appropriate for these discussions I guess ?
Vincent.
--- Tobias Frech <[EMAIL PROTECTED]> wrote:
> 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]
>
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]