Hibernate version: 2.1.6
Name and version of the database you are using: MySQL 4.0.14
The generated SQL (show_sql=true): insert into Cart_Shopable (id_cart, id, id_shopable) values (?, ?, ?)
I use a table with some extra colums for a association of a Cart and a Shopable (Cartitem). The problem I have: the constructor for Cart_Shopable is never called, so I can not set some default values for the additional columns.
<idbag name="shopables" table="Cart_Shopable" lazy="false">
<collection-id column="id" type="integer">
<generator class="hilo"/>
</collection-id>
<key column="id_cart"/>
<many-to-many column="id_shopable" class="com.itth.sto.om.Shopable" outer-join="auto"/>
</idbag>
Thanks Thomas
PS: Yes, I already ordered the bible "H. in A.", but can't wait for it here in germany ;-)
PPS: My real goal is to increase a counter in the association (number of the same items in the cart), do you have a pattern for this?
|