I have downloaded Middlegen-Hibernate-r5 and have successfully generated the hibernate mapping files (Reservation.hbm.xml Person.hbm.xml Flight.hbm.xml) to be used by the schema export.
I then run the following:
java -cp %CLASSPATH% org.hibernate.tool.hbm2ddl.SchemaExport --properties=hibernate.properties Reservation.hbm.xml Person.hbm.xml Flight.hbm.xml
And I get the following output/error:
Mar 17, 2009 2:03:56 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.3.1.GA
Mar 17, 2009 2:03:56 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Mar 17, 2009 2:03:56 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : javassist
Mar 17, 2009 2:03:56 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Mar 17, 2009 2:03:56 PM org.hibernate.cfg.Configuration addFile
INFO: Reading mappings from file: Reservation.hbm.xml
Mar 17, 2009 2:03:57 PM org.hibernate.util.DTDEntityResolver resolveEntity
SEVERE: Don't use old DTDs, read the Hibernate 3.x Migration Guide!
Mar 17, 2009 2:03:57 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: airline.hibernate.Reservation -> reservations
Mar 17, 2009 2:03:57 PM org.hibernate.cfg.Configuration addFile
INFO: Reading mappings from file: Person.hbm.xml
Mar 17, 2009 2:03:57 PM org.hibernate.util.DTDEntityResolver resolveEntity
SEVERE: Don't use old DTDs, read the Hibernate 3.x Migration Guide!
Mar 17, 2009 2:03:57 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: airline.hibernate.Person -> persons
Mar 17, 2009 2:03:57 PM org.hibernate.cfg.Configuration addFile
INFO: Reading mappings from file: Flight.hbm.xml
Mar 17, 2009 2:03:57 PM org.hibernate.util.DTDEntityResolver resolveEntity
SEVERE: Don't use old DTDs, read the Hibernate 3.x Migration Guide!
Mar 17, 2009 2:03:57 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: airline.hibernate.Flight -> flights
Mar 17, 2009 2:03:57 PM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.SQLServerDialect
Mar 17, 2009 2:03:57 PM org.hibernate.cfg.HbmBinder bindCollectionSecondPass
INFO: Mapping collection: airline.hibernate.Flight.reservations -> reservations
Mar 17, 2009 2:03:57 PM org.hibernate.tool.hbm2ddl.SchemaExport main
SEVERE: Error creating schema org.hibernate.MappingException: component class not found: airline.hibernate.ReservationPK at org.hibernate.mapping.Component.getComponentClass(Component.java:127)
at org.hibernate.tuple.component.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:156)
at org.hibernate.tuple.component.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:66)
at org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:61)
at org.hibernate.tuple.component.ComponentEntityModeToTuplizerMapping.<init>(ComponentEntityModeToTuplizerMapping.jav
a:76)
at org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:73)
at org.hibernate.mapping.Component.buildType(Component.java:175)
at org.hibernate.mapping.Component.getType(Component.java:168)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:175)
at org.hibernate.cfg.Configuration.iterateGenerators(Configuration.java:743)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:854)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:128)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:91)
at org.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:474)
Caused by: java.lang.ClassNotFoundException: airline.hibernate.ReservationPK
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:123)
at org.hibernate.mapping.Component.getComponentClass(Component.java:124)
... 13 more
org.hibernate.MappingException: component class not found: airline.hibernate.ReservationPK
at org.hibernate.mapping.Component.getComponentClass(Component.java:127)
at org.hibernate.tuple.component.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:156)
at org.hibernate.tuple.component.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:66)
at org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:61)
at org.hibernate.tuple.component.ComponentEntityModeToTuplizerMapping.<init>(ComponentEntityModeToTuplizerMapping.jav
a:76)
at org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:73)
at org.hibernate.mapping.Component.buildType(Component.java:175)
at org.hibernate.mapping.Component.getType(Component.java:168)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:175)
at org.hibernate.cfg.Configuration.iterateGenerators(Configuration.java:743)
at org.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:854)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:128)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:91)
at org.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:474)
Caused by: java.lang.ClassNotFoundException: airline.hibernate.ReservationPK
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:123)
at org.hibernate.mapping.Component.getComponentClass(Component.java:124)
... 13 more
|