Hi all,
I'm trying to generate the database schema using my mapping files. I keep getting the exception below.
One of my mapping files is as follows :
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin 2.1
http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->
<class
name="be.milieuinfo.cbb.model.AdresBe"
table="adres_be"
>
<meta attribute="class-description" inherit="false">
@hibernate.class
table="adres_be"
</meta>
<id
name="adrbeId"
type="java.lang.Integer"
column="adrbe_id"
>
<meta attribute="field-description">
@hibernate.id
generator-class="assigned"
type="java.lang.Integer"
column="adrbe_id"
</meta>
<generator class="assigned" />
</id>
<property
name="datumCreatie"
type="java.sql.Date"
column="datum_creatie"
not-null="true"
length="4"
>
<meta attribute="field-description">
@hibernate.property
column="datum_creatie"
length="4"
not-null="true"
</meta>
</property>
<property
name="userCreatie"
type="java.lang.String"
column="user_creatie"
not-null="true"
length="50"
>
<meta attribute="field-description">
@hibernate.property
column="user_creatie"
length="50"
not-null="true"
</meta>
</property>
<property
name="datumAanpassing"
type="java.sql.Date"
column="datum_aanpassing"
length="4"
>
<meta attribute="field-description">
@hibernate.property
column="datum_aanpassing"
length="4"
</meta>
</property>
<property
name="userAanpassing"
type="java.lang.String"
column="user_aanpassing"
length="50"
>
<meta attribute="field-description">
@hibernate.property
column="user_aanpassing"
length="50"
</meta>
</property>
<property
name="updatecount"
type="int"
column="updatecount"
not-null="true"
length="4"
>
<meta attribute="field-description">
@hibernate.property
column="updatecount"
length="4"
not-null="true"
</meta>
</property>
<!-- Associations -->
<!-- bi-directional one-to-many association to AdresBeHist -->
<set
name="adresBeHists"
lazy="false"
inverse="true"
cascade="none"
>
<meta attribute="field-description">
@hibernate.set
lazy="false"
inverse="true"
cascade="none"
@hibernate.collection-key
column="adrbe_id"
@hibernate.collection-one-to-many
class="be.milieuinfo.cbb.model.AdresBeHist"
</meta>
<key>
<column name="adrbe_id" />
</key>
<one-to-many
class="be.milieuinfo.cbb.model.AdresBeHist"
/>
</set>
<!-- bi-directional one-to-many association to AdresPerceel -->
<set
name="adresPerceels"
lazy="false"
inverse="true"
cascade="none"
>
<meta attribute="field-description">
@hibernate.set
lazy="false"
inverse="true"
cascade="none"
@hibernate.collection-key
column="adrbe_id"
@hibernate.collection-one-to-many
class="be.milieuinfo.cbb.model.AdresPerceel"
</meta>
<key>
<column name="adrbe_id" />
</key>
<one-to-many
class="be.milieuinfo.cbb.model.AdresPerceel"
/>
</set>
<!-- bi-directional one-to-many association to ExploitantAdre -->
<set
name="exploitantAdres"
lazy="false"
inverse="true"
cascade="none"
>
<meta attribute="field-description">
@hibernate.set
lazy="false"
inverse="true"
cascade="none"
@hibernate.collection-key
column="adrbe_id"
@hibernate.collection-one-to-many
class="be.milieuinfo.cbb.model.ExploitantAdre"
</meta>
<key>
<column name="adrbe_id" />
</key>
<one-to-many
class="be.milieuinfo.cbb.model.ExploitantAdre"
/>
</set>
<!-- bi-directional one-to-many association to Exploitatie -->
<set
name="exploitaties"
lazy="false"
inverse="true"
cascade="none"
>
<meta attribute="field-description">
@hibernate.set
lazy="false"
inverse="true"
cascade="none"
@hibernate.collection-key
column="adrbe_id"
@hibernate.collection-one-to-many
class="be.milieuinfo.cbb.model.Exploitatie"
</meta>
<key>
<column name="adrbe_id" />
</key>
<one-to-many
class="be.milieuinfo.cbb.model.Exploitatie"
/>
</set>
</class>
</hibernate-mapping>
Does anybody have an idea of what could be going wrong here?
Thanks in advance for helping me out.
Johan,
Hibernate version: 2.1.6
Mapping documents:Code between sessionFactory.openSession() and session.close():Full stack trace of any exception that occurs:Code:
[schemaexport] java.lang.NullPointerException
[schemaexport] at net.sf.hibernate.util.StringHelper.qualify(StringHelper.java:239)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:734)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:257)
[schemaexport] at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1173)
[schemaexport] at net.sf.hibernate.cfg.Configuration.add(Configuration.java:245)
[schemaexport] at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:167)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getConfiguration(SchemaExportTask.
java:185)
[schemaexport] at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(SchemaExportTask.java:131)
[schemaexport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[schemaexport] at org.apache.tools.ant.Task.perform(Task.java:364)
[schemaexport] at org.apache.tools.ant.Target.execute(Target.java:341)
[schemaexport] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[schemaexport] at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
[schemaexport] at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
[schemaexport] at org.apache.tools.ant.Main.runBuild(Main.java:673)
[schemaexport] at org.apache.tools.ant.Main.startAnt(Main.java:188)
[schemaexport] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
[schemaexport] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
Name and version of the database you are using:Informix, also tried on MySQL.