Hi,

I've used TDK 2.1 to generate a Webapp. My webapp-schema.xml looks like

this:

>>

<database>

<table name="CUSTOMER">

<column name="CUSTOMER_ID" required="true" autoIncrement="true"

primaryKey="true" type="INTEGER"/>

<column name="NAME" size="255" type="VARCHAR"/>

<column name="ADDRESS_ID" required="false" type="INTEGER"/>

<foreign-key foreignTable="ADRESS">

<reference local="PRIVAT_ADDRESS_ID"

foreign="ADDRESS_ID"/>

</foreign-key>

<column name="BUSINESS_ID" required="false" type="INTEGER"/>

<foreign-key foreignTable="ADDRESS">

<reference local="BUSINESS_ADDRESS_ID"

foreign="ADDRESS_ID"/>

</foreign-key>

</table>

<table name="ADDRESS">

<column name="ADDRESS_ID" required="true" autoIncrement="true"

primaryKey="true" type="INTEGER"/>

<column name="STREET" size="255" type="VARCHAR"/>

</table>

</database>

<<

I want to save a customer by using a HTML-Form with forgein-keys for privat-

and business-address in the customer table and both addresses in the

address-table.

How do I get the references for privat-address and business-address into my

customer-object ? (getPrimaryKey() + getAddressId() return null after saving

an address-object)

How to save the address entries in an intelligent way ?

(at the moment i do something like this by using the ParameterParser:

Address entry = new Address();

entry.setStreet(pp.getString(PREFIX+"street"));

entry.save();

)

Thanks and sorry for bugging you and my poor english ...



--
To unsubscribe, e-mail:   <mailto:turbine-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-user-help@;jakarta.apache.org>

Reply via email to