Hi all, sorry my bad english,
I look the thread, but my problem "persists".
I trying to create a simple project that contains 2 classes (in package) that represents a one-to-many relationship (one people have many cars).
My java files are in:
C:\TRABALHO\Auctions\org\hibernate\auctions
My java sources are declared as:
Code:
package org.hibernate.auction;
import java.util.*;
/**
* Created on Dec 18, 2003
* @author mrack
* @hibernate.class
*/
public class People extends Persistent { //Persistent have id attribute...
private List cars = new Vector();
//...
/**
* @hibernate.bag name="cars"
* @hibernate.collection-key column="owner"
* @hibernate.collection-one-to-many class="Car"
*/
public List getCars() {
return cars;
}
}
and
Code:
package org.hibernate.auction;
import java.util.*;
/**
* Created on Dec 18, 2003
* @author mrack
* @hibernate.class
*/
public class Car extends Persistent { //Persistent have id attribute...
private People owner;
//...
/**
* @return Returns the owner's car
* @hibernate.many-to-one class="People"
*/
public People getOwner() {
return owner;
}
}
My compiled java classes are in:
C:\TRABALHO\Auctions\org\hibernate\auctions
My ant script generate .hbm files correctly at
C:\TRABALHO\Auctions\org\hibernate\auctions
In other words:
C:\TRABALHO\Auctions\org\hibernate\auctions\People.java
C:\TRABALHO\Auctions\org\hibernate\auctions\Car.java
C:\TRABALHO\Auctions\org\hibernate\auctions\People.class
C:\TRABALHO\Auctions\org\hibernate\auctions\Car.class
C:\TRABALHO\Auctions\org\hibernate\auctions\People.hbm.xml
C:\TRABALHO\Auctions\org\hibernate\auctions\Car.hbm.xml
The problems occurs when I try to execute schemaExport, like below:
java -cp %CP% net.sf.hibernate.tool.hbm2ddl.SchemaExport --text --output=schema.ddl org\hibernate\auction\*.hbm.xml
at C:\TRABALHO\Auctions directory.
Note: var CP contains: ;lib\cglib2.jar;lib\commons-collections.jar;lib\commons-logging.jar;lib\dom4j.jar;lib\hibernate-tools.jar;lib\hibernate2.jar;lib\jdbc2_0-stdext.jar;lib\JSQLConnect.jar;lib\jta.jar;lib\odmg.jar;lib\xalan.jar;C:\TRABALHO\Auctions
The problem is that class "Car" was not found by schemaExport.
The workaround that I found was put fully-qualified name of "Car" and "People" in xdoclet-hibernate tags, like below:
Code:
package org.hibernate.auction;
import java.util.*;
/**
* Created on Dec 18, 2003
* @author mrack
* @hibernate.class
*/
public class People extends Persistent { //Persistent have id attribute...
private List cars = new Vector();
//...
/**
* @hibernate.bag name="cars"
* @hibernate.collection-key column="owner"
* @hibernate.collection-one-to-many class="org.hibernate.auction.Car"
*/
public List getCars() {
return cars;
}
}
and
Code:
package org.hibernate.auction;
import java.util.*;
/**
* Created on Dec 18, 2003
* @author mrack
* @hibernate.class
*/
public class Car extends Persistent { //Persistent have id attribute...
private People owner;
//...
/**
* @return Returns the owner's car
* @hibernate.many-to-one class="org.hibernate.auction.People"
*/
public People getOwner() {
return owner;
}
}
The question is: How I can execute schemaExport without use fully-qualified class-names in xdoclet-hibernate tags? Is a erroneous classpath configuration?
Thanks for all.