Somethins is either wrong with the java or the xml but i have no idea which it is. Just that it won't compile.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="EPOS.Database.Invoices" table="Invoices">
<id column="ID" name="ID" type="long">
<generator class="increment"/>
</id>
<property name="Date" column="InvDate"/>
<property name="Ref"/>
<property name="Supplier"/>
<idbag name="Rows" table="Invoice_rows">
<collection-id type="long" column="Invoice_row_ID's">
<generator class="sequence"/>
</collection-id>
<key column="ID"/>
<composite-element class="Row">
<property name="ItemID" />
<property name="Name" />
<property name="Catergory" />
<property name="BoxQuantity" />
<property name="BoxNumber" />
<property name="BoxPrice" />
</composite-element>
</idbag>
</class>
</hibernate-mapping>
Code:
package EPOS.Database;
import EPOS.Amount;
import java.util.ArrayList;
import java.util.Collection;
public class Invoices {
private long ID;
private String Date = "";
private String Ref = "";
private String Supplier = "";
private Collection Rows = new ArrayList();
public Invoices() {}
public void setID (Long ID) {this.ID = ID;}
public void setDate (String Date) {this.Date = Date;}
public void setRef (String Ref) {this.Ref = Ref;}
public void setSupplier (String Supplier) {this.Supplier = Supplier;}
public void setRows (Collection Rows) {this.Rows = Rows;}
public long getID () {return ID;}
public String getDate () {return Date;}
public String getRef () {return Ref;}
public String getSupplier () {return Supplier;}
public Collection getRows () {return Rows;}
}
Code:
Exception in thread "AWT-EventQueue-0" org.hibernate.MappingException: class Rows not found while looking for property: ItemID
Code virtual copied from Java Persistence with Hibernate. Obviously i misread something.