You just have to organize something like
seto of B's in yur A and set of C's in your B.
This has to be done per Hibernate (<bag>'s in hibernate.cfg.xml and List
getters setters in DAO Classes).
When you've done this, you can iterate all the attributes without big
prob's. After user submiting new values, struts will change the beans in
the ActionForm, where your tables-DAO are stored. After that you have to
call your Hibernate persistance manager and persist the changes.
Cheers
Danny
Bouvet Konsulent schrieb:
hello,
I am using Struts 1.2.7 together with Hibernate 3.0. My datamodel is not
too complex, but one of my Struts-forms needs to fetch data from several
tables. My tables are called A, B and C. One A contains many B's and one
B contains many C's. In Struts, I would need to display data from all
three tables and also be able to save changes. How would I go about to
do this? In MyForm.java, which primarily models A, I have getters and
setters for all of A columns, like name, id etc. But what about B and C?
I guess it would not be possible to have these as Sets in MyForm.java? I
could maybe model B as an ArrayList and use <nested:iterate> and
<nested:text> in my jsp, but then again: what about C?
To just display the data would not be a big problem, but when I want to
make changes to the data in e.g. C, I would also need some setters for
the properties. Really don't know how to do this...
Any ideas would be highly appreciated!
cheers,
pj
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]