sorry for the bad formatting in my previous mail... I try again:

thanks for the answer!

I have tried to follow your suggestions, but I can not get Struts to
populate my Hibernate POJOs...
This is the code I am using:
MyForm.java:
private Set Bs; //this also has a getter and setter

B.java (which is a Hibernate-generated POJO) contains e.g. the following
property
private String formulaPart; //this also has a getter and setter

my A.hbm.xml contains the following:
    <!-- bi-directional one-to-many association to B -->
    <set name="Bs" lazy="true" inverse="true" cascade="none">
        <key>
            <column name="GEO_ID" />
        </key>        
        <one-to-many class="com.acme.generated.B" />
    </set>

my B.hbm.xml contains the following:
    <!-- bi-directional many-to-one association to A -->
    <many-to-one name="A" class="com.acme.generated.A" not-null="true">
        <column name="GEO_ID" />
    </many-to-one>

and in my jsp I try to do the following:

<html:form action="myAction">
        <logic:iterate id="B" name="myForm" property="Bs">
            <html:text name="B" property="formulaPart"/>       
            <html:submit>
                <bean:message key="button.save"/>
            </html:submit>
        </logic:iterate>
</html:form>

when submitting the form, the value in B (formulaPart) is not updated.
Any ideas what I'm doing wrong?

Thanks for your help!

cheers,
pj


Danny wrote:
>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.


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

Reply via email to