Well, I've been working with the tool suite to conduct roundtrip engineering with my user-defined hbm.xml mapping files. I've been doing this with MySQL flawlessly, but I tried to make appropriate configuration changes to do this with MS SQL Server.
hibernate version: 2.1
hibernate.cfg.xml file:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- <property name="connection.url">jdbc:mysql://localhost/hibernatetest</property> -->
<!-- <property name="connection.driver_class">com.mysql.jdbc.Driver</property> -->
<!-- <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property> -->
<property name="connection.url">jdbc:bea:sqlserver://localhost;User=root;Password=neadg5521;DatabaseName=neadg_data</property>
<property name="connection.driver_class">weblogic.jdbc.sqlserver.SQLServerDriver</property>
<property name="connection.username"></property>
<property name="connection.password"></property>
<property name="show_sql">true</property>
<property name="dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<mapping resource="neadg/model/hibernate/ChangeRequestSubmission.hbm.xml"/>
<mapping resource="neadg/model/hibernate/CCBVote.hbm.xml"/>
<mapping resource="neadg/model/hibernate/UserAccount.hbm.xml"/>
<mapping resource="neadg/model/hibernate/UserRoleGroup.hbm.xml"/>
<mapping resource="neadg/model/hibernate/GuideManagerFilter.hbm.xml"/>
<mapping resource="neadg/model/hibernate/CCBDecision.hbm.xml"/>
<mapping resource="neadg/model/hibernate/CommentHistory.hbm.xml"/>
</session-factory>
</hibernate-configuration>
mapping files for each POJO not relevant here...they work with MySQL settings.
Full stack trace when running hbm2java followed by SchemaExport (in ant):
Buildfile: build.xml
clean:
[delete] Deleting directory C:\usr\local\projects\hibernatetest\gensrc
[delete] Deleting directory C:\usr\local\projects\hibernatetest\build\neadg
prepare:
[mkdir] Created dir: C:\usr\local\projects\hibernatetest\gensrc
bottomup.hbm2java:
[hbm2java] Processing 7 files.
[hbm2java] Building hibernate objects
[hbm2java] (hbm2java.ClassMapping 649 ) Could not find UserType:
neadg.model.hibernate.ChangeRequestSubmission. Using the type 'neadg.model.hiber
nate.ChangeRequestSubmission' directly instead. (java.lang.ClassNotFoundExceptio
n: neadg.model.hibernate.ChangeRequestSubmission)
[hbm2java] (hbm2java.ClassMapping 649 ) Could not find UserType:
neadg.model.hibernate.ChangeRequestSubmission. Using the type 'neadg.model.hiber
nate.ChangeRequestSubmission' directly instead. (java.lang.ClassNotFoundExceptio
n: neadg.model.hibernate.ChangeRequestSubmission)
topdown.xdoclet:
[hibernatedoclet] (XDocletMain.start 47 ) Running <hibernate/
>
topdown.hbm2ddl:
[javac] Compiling 7 source files to C:\usr\local\projects\hibernatetest\buil
d
[copy] Copying 7 files to C:\usr\local\projects\hibernatetest\build
[schemaexport] (cfg.Environment 403 ) Hibernate 2.0.3
[schemaexport] (cfg.Environment 432 ) hibernate.properties n
ot found
[schemaexport] (cfg.Environment 452 ) using CGLIB reflection
optimizer
[schemaexport] (cfg.Environment 462 ) JVM proxy support: tru
e
[schemaexport] (cfg.Configuration 703 ) Configuration resource
: /hibernate.cfg.xml
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/ChangeRequestSubmission.hbm.xml
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/ChangeRequestSubmission.hbm.xml
[schemaexport] (cfg.Binder 178 ) Mapping class: neadg.m
odel.hibernate.ChangeRequestSubmission -> change_request_submission
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/CCBVote.hbm.xml
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/CCBVote.hbm.xml
[schemaexport] (cfg.Binder 178 ) Mapping class: neadg.m
odel.hibernate.CCBVote -> ccb_vote
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/UserAccount.hbm.xml
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/UserAccount.hbm.xml
[schemaexport] (cfg.Binder 178 ) Mapping class: neadg.m
odel.hibernate.UserAccount -> user_account
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/UserRoleGroup.hbm.xml
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/UserRoleGroup.hbm.xml
[schemaexport] (cfg.Binder 178 ) Mapping class: neadg.m
odel.hibernate.UserRoleGroup -> user_role_group
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/GuideManagerFilter.hbm.xml
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/GuideManagerFilter.hbm.xml
[schemaexport] (cfg.Binder 178 ) Mapping class: neadg.m
odel.hibernate.GuideManagerFilter -> guide_manager_filter
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/CCBDecision.hbm.xml
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/CCBDecision.hbm.xml
[schemaexport] (cfg.Binder 178 ) Mapping class: neadg.m
odel.hibernate.CCBDecision -> ccb_decision
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/CommentHistory.hbm.xml
[schemaexport] (cfg.Configuration 270 ) Mapping resource: nead
g/model/hibernate/CommentHistory.hbm.xml
[schemaexport] (cfg.Binder 178 ) Mapping class: neadg.m
odel.hibernate.CommentHistory -> comment_history
[schemaexport] (cfg.Configuration 885 ) Configured SessionFact
ory: null
BUILD FAILED
C:\usr\local\projects\hibernatetest\build.xml:146: Schema text failed: Dialect c
lass not found: net.sf.hibernate.dialect.SQLServerDialect
I have the weblogic jdbc driver in my classpath here.... where the heck is the SQLServerDialect class? My classpath for these ant tasks points to my lib direcory which contains the followin jar files:
08/27/2003 10:49 AM 737,884 ant.jar
08/27/2003 10:49 AM 235,686 c3p0.jar
08/27/2003 10:49 AM 148,230 cglib-asm.jar
08/27/2003 10:49 AM 118,483 commons-beanutils.jar
08/27/2003 10:49 AM 165,119 commons-collections.jar
08/27/2003 10:49 AM 62,998 commons-dbcp.jar
08/27/2003 10:49 AM 63,980 commons-lang.jar
08/27/2003 10:49 AM 31,605 commons-logging.jar
08/27/2003 10:49 AM 28,930 commons-pool.jar
08/27/2003 10:49 AM 17,978 connector.jar
08/27/2003 10:49 AM 486,522 dom4j.jar
09/23/2003 02:20 PM 87,995 hibern8ide.jar
08/27/2003 10:49 AM 722,582 hibernate-2.0.3.jar
09/23/2003 02:19 PM 114,750 hibernate-tools.jar
06/15/2003 12:15 PM 486,775 hsqldb.jar
08/27/2003 10:49 AM 104,359 jaas.jar
02/26/2004 02:49 PM 0 jarlist.txt
08/27/2003 10:49 AM 293,789 jcs.jar
08/27/2003 10:49 AM 6,727 jdbc2_0-stdext.jar
06/13/2003 08:09 AM 127,118 jdom.jar
09/24/2003 05:42 PM 2,662 joi-ext.jar
08/27/2003 10:49 AM 8,812 jta.jar
08/27/2003 10:49 AM 121,070 junit.jar
09/23/2003 12:36 PM 352,668 log4j-1.2.8.jar
09/23/2003 10:59 AM 32,172 maven-xdoclet-plugin-1.2b4.jar
09/23/2003 01:55 PM 154,465 middlegen-2.0-b2-dev.jar
09/23/2003 01:55 PM 38,730 middlegen-hibernate-plugin-2.0-b2-dev.jar
01/13/2004 04:15 PM 235,774 mysql-connector-java-3.0.10-stable-bin.jar
08/27/2003 10:49 AM 13,091 odmg.jar
08/27/2003 10:49 AM 671,546 optional.jar
09/24/2003 06:22 PM 140,471 pf-joi-full.jar
08/27/2003 10:49 AM 329,103 proxool.jar
09/23/2003 01:55 PM 359,924 velocity-1.4-dev.jar
02/04/2004 10:19 AM 251,032 wlbase.jar
02/04/2004 10:19 AM 82,360 wlsqlserver.jar
02/04/2004 10:19 AM 69,527 wlutil.jar
08/27/2003 10:49 AM 997,276 xalan.jar
09/23/2003 10:59 AM 150,173 xdoclet-1.2b4.jar
09/23/2003 10:59 AM 22,948 xdoclet-hibernate-module-1.2b4.jar
09/23/2003 10:59 AM 55,706 xdoclet-xdoclet-module-1.2b4.jar
08/27/2003 10:49 AM 895,813 xerces.jar
09/23/2003 10:59 AM 234,448 xjavadoc-1.0.jar
08/27/2003 10:49 AM 123,705 xml-apis.jar
Help, please!
|