Hi
I am using hibernate 3.x to persist a mySQL data base. This is my first project using hibernate I have created the mapping document POJOS and I can generate the database. However I have some doubts about the way the database is generated I have a Joined-subclass that has a one-to-one element. In the generated database tables I couldn’t find even a hint of the one-to-one mapping here are the tables and hbm.xml files.
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping SYSTEM "hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<joined-subclass name=" AcademicReport"
extends="RestrictedAccess"
table="academic_report">
<key column="ra_id"/>
<set name="livecourses">
<key column="adademic_report_id"/>
<one-to-many class=" LiveCourse"/>
</set>
<one-to-one name="student"
class="StudentUser"
constrained="true"/>
</joined-subclass>
</hibernate-mapping>
mysql> describe academic_report;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| ra_id | int(11) | NO | PRI | | |
+-------+---------+------+-----+---------+-------+
1 row in set (1.02 sec)
mysql> describe student_user;
+-----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| uid | varchar(255) | NO | PRI | | |
| course_id | int(11) | YES | MUL | NULL | |
+-----------+--------------+------+-----+---------+-------+
2 rows in set (0.13 sec)
could you tell me if this is correct or how I should correct it