Greetings!
I'm actually new to this list and I'm here to ask for help (or to report
a bug if it happens to be).
So my problem is that hibernate plugin 1.0 is not accepting standart
tags. I don't think I'm doing anything wrong, but...
Thank you for your assistance!
Shipment.java
package ru.lever_lever.data.persistent;
import java.util.Date;
import java.util.List;
/**
*
* @hibernate.class
*/
public class Shipment {
private Long id;
private Date time;
// входные данные
private List<ShipmentBox> boxes;
private long belorussianTtnNumber;
private Division toDivision;
private Document belorussianTtn;
Shipment() {
this.time = new Date();
}
public static final Shipment newInstance() {
Shipment shipment = new Shipment();
return shipment;
}
/**
* @hibernate.id generator-class ="sequence"
* @hibernate.column name = "id"
*/
public Long getId() {
return id;
}
void setId(Long id) {
this.id = id;
}
/**
* @hibernate.property
*/
public long getBelorussianTtnNumber() {
return belorussianTtnNumber;
}
public void setBelorussianTtnNumber(long belorussianTtnNumber) {
this.belorussianTtnNumber = belorussianTtnNumber;
}
/**
* NOTE THESE LINES
*
* @hibernate.list cascade = "none"
* @hibernate.collection-key column = "box_id"
* @hibernate.collection-index column = "listindex"
* @hibernate.collection-one-to-many class =
* "ru.lever_lever.data.persistent.ShipmentBox"
*
*/
public List<ShipmentBox> getBoxes() {
return boxes;
}
void setBoxes(List<ShipmentBox> boxes) {
this.boxes = boxes;
}
public void addBox(ShipmentBox box) {
box.setShipment(this);
getBoxes().add(box);
}
public void removeBox(ShipmentBox box) {
getBoxes().remove(box);
box.setShipment(null);
}
/**
* @hibernate.property
*/
public Date getTime() {
return time;
}
public void setTime(Date time) {
this.time = time;
}
/**
* @hibernate.many-to-one not-null = "true" column = "to_id"
*/
public Division getToDivision() {
return toDivision;
}
public void setToDivision(Division toDivision) {
this.toDivision = toDivision;
}
/**
* @hibernate.property
*/
public Document getBelorussianTtn() {
return belorussianTtn;
}
public void setBelorussianTtn(Document belorussianTtn) {
this.belorussianTtn = belorussianTtn;
}
}
And a stack trace (shortended a bit :-) ):
Buildfile: D:\home\lever-sandbox\lever-light-client\build.xml
[taskdef] Could not load definitions from resource
net/sf/antcontrib/antlib.xml. It could not be found.
hbm-xdoclet:
[delete] Deleting 14 files from
D:\home\lever-sandbox\lever-light-client\src
[xdoclet2] Running org.xdoclet.plugin.hibernate.HibernateMappingPlugin
[xdoclet2] * Generate mapping for 'AbstractDivision' entity
[xdoclet2] * Generate mapping for 'DivisionBinding' entity
[xdoclet2] * Generate mapping for 'Document' entity
[xdoclet2] * Generate mapping for 'Journal' entity
[xdoclet2] * Generate mapping for 'Price' entity
[xdoclet2] * Generate mapping for 'PriceMod' entity
[xdoclet2] * Generate mapping for 'Shipment' entity
[xdoclet2] 17:08:20,921 WARN JexlExpression:78 - Caught exception
evaluating: [EMAIL PROTECTED] Reason:
java.lang.RuntimeException: no index or list-index defined in class
Shipment for boxes
[xdoclet2] java.lang.RuntimeException: no index or list-index defined
in class Shipment for boxes
[xdoclet2] at org.generama.Plugin.assertTrue(Plugin.java:126)
..........................
[xdoclet2] * Generate mapping for 'ShipmentBox' entity
[xdoclet2] * Generate mapping for 'ShipmentLine' entity
[xdoclet2] * Generate mapping for 'SynchroMark' entity
[xdoclet2] * Generate mapping for 'TradeOperation' entity
[xdoclet2] * Generate mapping for 'TradeOperationLine' entity
[xdoclet2] * Generate mapping for 'TradeSession' entity
[xdoclet2] * Generate mapping for 'WebUser' entity
[xdoclet2] Unknown tag: @hibernate.collection-key in
file:/D:/home/lever-sandbox/lever-light-client/src/ru/lever_lever/data/persistent/Shipment.java
(line 62)
[xdoclet2] Unknown tag: @hibernate.collection-index in
file:/D:/home/lever-sandbox/lever-light-client/src/ru/lever_lever/data/persistent/Shipment.java
(line 63)
[xdoclet2] Unknown tag: @hibernate.collection-one-to-many in
file:/D:/home/lever-sandbox/lever-light-client/src/ru/lever_lever/data/persistent/Shipment.java
(line 64)
BUILD SUCCESSFUL
Total time: 11 seconds