this is a really wierd problem, using the latest stable hibernate, heres my mapping.. why is a column definitionGroupid created?
I stripped down the mapping to its bare minimum and also have the bi-directional config there but thats commented out
<class name="els.model.Definition" table="definition" >
<id name="id" column="id" type="long" unsaved-value="-1">
<generator class="increment"/>
</id>
<!--many-to-one name="definitionGroup" class="els.model.DefinitionGroup" column="definitionGroupId"/-->
</class>
<class name="els.model.DefinitionGroup" table="definitiongroup" >
<id name="id" column="id" type="long" unsaved-value="-1">
<generator class="increment"/>
</id>
<!--
<set name="definitions" table="definition" lazy="true" cascade="all-delete-orphan" inverse="true">
<key column="definitionGroupId"/>
<one-to-many class="els.model.Definition"/>
</set>
-->
</class>
generated sql
create table definition (
id BIGINT not null,
primary key (id)
)
create table definitiongroup (
id BIGINT not null,
definitionGroupid BIGINT,
primary key (id)
)
|