Hi,
Sorry for late reply.
I was using the examples in hibernate-middlegen-r4 that have 3 tables: person, airline, reservation. I have generated the hbm files and class files. I used the following bat file to generte the ddl file.
@echo off
rem -------------------------------------------------------------------
rem Execute SchemaExport tool
rem -------------------------------------------------------------------
set JDBC_DRIVER=C:\middlegen\middlegen-hibernate-r4\lib\mysql-connector-java-3.0.11-stable-bin.jar
set HIBERNATE_HOME=c:\hibernate-2.1
set LIB=%HIBERNATE_HOME%\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=c:\middlegen\middlegen-hibernate-r4\build\classes;%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\commons-logging-1.0.3.jar;%LIB%\commons-collections-2.1.jar;%LIB%\commons-lang-1.0.1.jar;%LIB%\cglib-2.0-rc2.jar;%LIB%\dom4j-1.4.jar;%LIB%\odmg-3.0.jar;%LIB%\xml-apis.jar;%LIB%\xerces-2.4.0.jar;%LIB%\xalan-2.4.0.jar;.
java -cp %CP%;LIB net.sf.hibernate.tool.hbm2ddl.SchemaExport --output=my_schema.ddl *.xml
It gave the following messages:
May 25, 2004 2:41:59 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.3
May 25, 2004 2:41:59 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: loaded properties from resource hibernate.properties: {hibernate.connectio
n.driver_class=com.mysql.jdbc.Driver, hibernate.cglib.use_reflection_optimizer=t
rue, hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider, hibernate
.cache.use_query_cache=true, hibernate.max_fetch_depth=1, hibernate.dialect=net.
sf.hibernate.dialect.MySQLDialect, hibernate.jdbc.use_streams_for_binary=true, h
ibernate.jdbc.batch_size=0, hibernate.query.substitutions=true 1, false 0, yes '
Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=ro
ot, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:
mysql://localhost:3306/airline, hibernate.show_sql=true, hibernate.connection.pa
ssword=root, hibernate.connection.pool_size=1}
May 25, 2004 2:41:59 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: using java.io streams to persist binary types
May 25, 2004 2:41:59 PM net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
May 25, 2004 2:41:59 PM net.sf.hibernate.cfg.Configuration addFile
INFO: Mapping file: Flight.hbm.xml
May 25, 2004 2:42:00 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: airline.hibernate.Flight -> flights
May 25, 2004 2:42:00 PM net.sf.hibernate.cfg.Configuration addFile
INFO: Mapping file: Person.hbm.xml
May 25, 2004 2:42:00 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: airline.hibernate.Person -> persons
May 25, 2004 2:42:00 PM net.sf.hibernate.cfg.Configuration addFile
INFO: Mapping file: Reservation.hbm.xml
May 25, 2004 2:42:00 PM net.sf.hibernate.cfg.Binder bindRootClass
INFO: Mapping class: airline.hibernate.Reservation -> reservations
Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/cglib/beans/Bu
lkBeanException
at net.sf.hibernate.util.ReflectHelper.getBulkBean(ReflectHelper.java:17
0)
at net.sf.hibernate.type.ComponentType.<init>(ComponentType.java:110)
at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:899)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:287)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:171)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:289
)
Any idea or suggestion?
thanx.