Hi. I'm creating a catalog navigation servlet using hibernate for persistent layer. I have basically two tables, catalog and category ones. They are references by a foregin key, each catalog contains some categories. This foreign key is on category table, referencing one catalog.
In the catalog mapping xml file, i have mapped the many-to-one relationship using a <list>, with a <index column = "id_catalog">.
When i load persitent objects, for each catalog, categories appears in order using index as reference.
But what i want is on creating a persitent object, this field should be autogenerated, in order to not to find max value of index and putting it on the object manually.
Only writting <index column> on list mapped xml file it not generate the index automatically, so i would want to know what to write in the xml so this process can be user transparent.
Thanks and sorry for my engilsh :)
|