Joined: Wed Apr 27, 2005 2:11 am Posts: 4
|
I'm getting an exception when I run the schema export tool, but I can't figure out what's wrong with my mapping file. The error generated is not very helpful: "invalid mapping"
Hibernate version: 2.1
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping.dtd">
<hibernate-mapping>
<class name="Artist" table="artist">
<id name="id" column="id" type="long" unsaved-value="-1">
<generator class="native"/>
</id>
<property name="name" column="name" type="string" not-null="true"/>
<set name="albums" cascade="all" inverse="true" lazy="true">
<key column="artist_id" not-null="true"/>
<one-to-many class="Record"/>
</set>
</class>
<class name="Record" table="record">
<id name="id" column="id" type="long" unsaved-value="-1">
<generator class="native"/>
</id>
<property name="title" column="title" type="string" not-null="true"/>
<property name="year" column="year" type="string" length="4" not-null="true"/>
<property name="label" column="label" type="string" not-null="true"/>
<property name="limit" column="limit" type="integer" not-null="true"/>
<property name="color" column="color" type="string" not-null="true"/>
<many-to-one name="artist" class="Artist" column="artist_id"/>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
Schema text failed: net.sf.hibernate.MappingException: invalid mapping
Name and version of the database you are using:
Postgres 7.4.7
|
|