The artifact generation is failing on Invoice.hbm.xml, where it's failing is a complete mystery to me as I was using a similar mapping with no problems the other day. I'm sure there's an obvious mistake somewhere but this could really do with a fresh pair of eyes. Also, does anyone know how to get more error information from the artifcat generation tool.
A little bit more background information. When an invoice is paid it becomes a paid invoice with a paid date. If an invoice is only part paid it is reissued and a letter is appended to its invoice number and it now has a parent invoice.
Hibernate version:
3.05
Mapping documents:
hibernate.cfg.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">
org.hsqldb.jdbcDriver
</property>
<property name="connection.url">
jdbc:hsqldb:hsql://localhost/
</property>
<property name="connection.username">sa</property>
<property name="dialect">
org.hibernate.dialect.HSQLDialect
</property>
<property name="hbm2ddl.auto">create</property>
<property name="jdbc.batch_size">50</property>
<property name="show_sql">true</property>
<property name="use_sql_comments">true</property>
<property name="query.substitutions">true</property>
<property name="c3p0.max_size">5</property>
<property name="c3p0.min_size">1</property>
<property name="c3p0.timeout">5000</property>
<property name="c3p0.max_statements">100</property>
<property name="c3p0.idle_test_period">3000</property>
<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.validate">true</property>
<mapping resource="Customer.hbm.xml" />
<mapping resource="Ledger.hbm.xml" />
<mapping resource="Group.hbm.xml" />
<mapping resource="Site.hbm.xml" />
<mapping resource="Invoice.hbm.xml" />
</session-factory>
</hibernate-configuration>
Customer.hbm.xmlCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.npower.invoiceauditor.model.Customer">
<id name="id" type="java.lang.Long" unsaved-value="null">
<generator class="hilo" />
</id>
<property name="customerName" type="java.lang.String"
unique="true" not-null="true" length="128" />
<property name="paymentTerms" type="java.lang.Integer"/>
<set name="ledgers" inverse="true" cascade="all">
<key column="customer"/>
<one-to-many class="com.npower.invoiceauditor.model.Ledger" />
</set>
</class>
</hibernate-mapping>
Ledger.hbm.xmlCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.npower.invoiceauditor.model.Ledger">
<id name="id" type="java.lang.Long" unsaved-value="null">
<generator class="hilo" />
</id>
<property name="ledgerNumber" type="int" />
<many-to-one name="customer"
class="com.npower.invoiceauditor.model.Customer" />
<set name="groups" cascade="all" inverse="true">
<key column="ledger"/>
<one-to-many class="com.npower.invoiceauditor.model.Group" />
</set>
</class>
</hibernate-mapping>
Group.hbm.xmlCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.npower.invoiceauditor.model.Group" table="GROUPOFSITES">
<id name="id" type="java.lang.Long" unsaved-value="null">
<generator class="hilo" />
</id>
<property name="groupNumber" type="java.lang.String"
not-null="true" unique="false" length="4" />
<many-to-one name="ledger"
class="com.npower.invoiceauditor.model.Ledger" />
<set name="sites" cascade="all" inverse="true" order-by="accountnumber desc">
<key column="parentGroup"/>
<one-to-many class="com.npower.invoiceauditor.model.Site" />
</set>
</class>
</hibernate-mapping>
Site.hbm.xmlCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.npower.invoiceauditor.model.Site">
<id name="id" type="java.lang.Long" unsaved-value="null">
<generator class="hilo" />
</id>
<property name="accountNumber" type="java.lang.String"
unique="false" not-null="true" length="8" />
<many-to-one name="parentGroup"
class="com.npower.invoiceauditor.model.Group" />
<set name="unpaidInvoices" cascade="all" inverse="true">
<key column="site"/>
<one-to-many class="com.npower.invoiceauditor.model.UnpaidInvoice" />
</set>
<set name="paidInvoices" cascade="all" inverse="true">
<key column="site"/>
<one-to-many class="com.npower.invoiceauditor.model.PaidInvoice" />
</set>
</class>
</hibernate-mapping>
Invoice.hbm.xmlCode:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.npower.invoiceauditor.model.Invoice">
<id name="id" type="java.lang.Long" unsaved-value="null">
<generator class="hilo" />
</id>
<property name="invoiceNumber" type="java.lang.String"
unique="false" not-null="true" length="10" />
<property name="paid" type="java.lang.Boolean" not-null="true" />
<property name="value" type="java.math.BigDecimal"
not-null="true" />
<property name="dateDue" type="java.util.Date" not-null="true" />
<joined-subclass
name="com.npower.invoiceauditor.model.UnpaidInvoice">
<key column="invoice" />
<many-to-one name="site" />
</joined-subclass>
<joined-subclass
name="com.npower.invoiceauditor.model.PaidInvoice" ">
<key column="invoice" />
<property name="datePaid" type="java.util.Date"
not-null="true" />
<many-to-one name="site" />
<set name="paidReissues" cascade="all" inverse="true">
<key column="paidParent" />
<one-to-many
class="com.npower.invoiceauditor.model.PaidReissue" />
</set>
<set name="unpaidReissues" cascade="all" inverse="true">
<key column="unpaidParent" />
<one-to-many
class="com.npower.invoiceauditor.model.UnpaidReissue" />
</set>
</joined-subclass>
<joined-subclass
name="com.npower.invoiceauditor.model.PaidReissue">
<key column="invoice" />
<property name="datePaid" type="java.util.Date"
not-null="true" />
<many-to-one name="paidParent"
class="com.npower.invoiceauditor.model.PaidInvoice" />
</joined-subclass>
<joined-subclass
name="com.npower.invoiceauditor.model.UnpaidReissue">
<key column="invoice" />
<many-to-one name="unpaidParent"
class="com.npower.invoiceauditor.model.PaidInvoice" />
</joined-subclass>
</class>
</hibernate-mapping>