Hi,
I'm new here but have started working on a project that will likely use Hibernate as its storage interface, and hopefully Search at a later date too.
To get familiar with Hibernate I'm going through this tutorial:
http://viralpatel.net/blogs/2011/12/hibernate-one-to-many-xml-mapping-tutorial.htmlBut Step 8 of the tutorial, the point at which a "list-index" column is added to the "employee" table, does not seem to work.
<list name="employees" table="employee" inverse="false" cascade="all">
<key column="department_id" />
<list-index column="idx" />
<one-to-many class="net.viralpatel.hibernate.Employee" />
</list>
The value of the "idx" column is not automatically incrementing...
This is what I get:
mysql> select * from employee;
+-------------+-----------+----------+------------+------------+---------------+-----+
| employee_id | firstname | lastname | birth_date | cell_phone | department_id | idx |
+-------------+-----------+----------+------------+------------+---------------+-----+
| 1 | Nina | Mayers | 1970-01-01 | 1212 | 115 | 0 |
| 2 | Tony | Almeida | 1970-01-01 | 4343 | 115 | 0 |
+-------------+-----------+----------+------------+------------+---------------+-----+
This is what the tutorial claims I should get:
mysql> select * from employee;
+-------------+-----------+----------+------------+------------+---------------+-----+
| employee_id | firstname | lastname | birth_date | cell_phone | department_id | idx |
+-------------+-----------+----------+------------+------------+---------------+-----+
| 1 | Nina | Mayers | 1970-01-01 | 1212 | 115 | 0 |
| 2 | Tony | Almeida | 1970-01-01 | 4343 | 115 | 1 |
+-------------+-----------+----------+------------+------------+---------------+-----+
All code and configuration has been taken directly from the linked tutorial, so I won't add more listings unless requested.
Thanks in advance for any help.
Alex