Hibernate version:
Hibernate 3
Name and version of the database you are using:
MySQL 5
MySQL Driver Version
5.1.7 and 5.0.8
Hibernate does not resolve foreign key relations
SQL:
Code:
CREATE TABLE IF NOT EXISTS `test`.`item` (
`id` INT NOT NULL AUTO_INCREMENT ,
`reconstruction_id` INT NOT NULL ,
`type` VARCHAR(45) NULL ,
PRIMARY KEY (`id`) ,
INDEX `item_FKIndex1` (`reconstruction_id` ASC) ,
CONSTRAINT `Rel_55`
FOREIGN KEY (`reconstruction_id` )
REFERENCES `test`.`reconstruction` (`id` ))
PACK_KEYS = 0
ROW_FORMAT = DEFAULT;
Mapping File:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 02.03.2009 11:45:10 by Hibernate Tools 3.2.0.beta8 -->
<hibernate-mapping>
<class name="io.database.autogenerated.DBItem" table="item" catalog="test">
<comment></comment>
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="increment" />
</id>
<property name="reconstructionId" type="int">
<column name="reconstruction_id" not-null="true">
<comment></comment>
</column>
</property>
<property name="type" type="java.lang.Boolean">
<column name="type">
<comment></comment>
</column>
</property>
</class>
</hibernate-mapping>