cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Man <Martin....@seznam.cz>
Subject Re: [c2] multi-add database action
Date Fri, 18 May 2001 18:24:20 GMT
On Wed, May 16, 2001 at 05:11:02PM -0400, Donald Ball wrote:
> someone (martin?) had posted a question regarding modifying berin's
no not me ;-)

> database add action to add multiple rows to a table. i have a similar need
> now. i want to add not just multiple rows to a table, i want to add
> multiple rows to multiple tables from one form. after some pondering, i
> was thinking a scheme like this might be good. the form descriptor would
> be expanded to allow multiple tables, and the param attribute values could
> have wildcards in them:
> 
> <map>
>   <table name="product_table">
>     <keys>
>       <key param="id" dbcol="id" type="int" mode="manual"/>
>     </keys>
>     <values>
>       <value param="name" dbcol="name" type="string"/>
>     </values>
>   </table>
>   <table name="product_meta_element_table">
>     <keys>
>       <key param="id" dbcol="product_id" type="int" mode="manual"/>
>       <key param="product_meta_element_name_*" dbcol="name" type="string"/>
>     </keys>
>     <values>
>       <value param="product_meta_element_value_*" dbcol="value" type="string"/>
>     </values>
>   </table>
> </map>

adding rows to multiple tables should be straight forward, multicolumn keys
work, 

these wildcards would mean iterating over all request parameters and trying
whether they match to the param attribute, can imagine code will be somehow
complicated :-)), but anyway good idea of implementing it, will take a look
into it after adding some new functionality to validator actions :))

> 
> for each request parameter that fit the wildcard pattern (e.g.
> product_meta_element_name_1), if all other wildcarded parameters also had
> a similarly named request parameter (product_meta_element_value_1), a row
> would be inserted into the table.
> 
> any comments? berin, do your database actions handle multi-column primary
> keys properly right now?
> 
> - donald
> 
martin
-- 
-------------------------------------------------------------------------------
"Only dead fish swims with a stream"
gpg_key_available: http://globales.cz/~mman/martin.man.gpg
gpg_key_fingerprint: 2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message