没有错,你点了后,只是生成了.xml 文件而没有产生表对应的子对象,他要你用hbm2java 去自动生成
写法:
1.进到hbm2java所在目录
2. hbm2java h:\sample\*.xml(这个是你先生成的xml文件目录) --output=h:\sample (这个是你要生成的持久化对象的目录)
写法:
1.进到hbm2java所在目录
2. hbm2java h:\sample\*.xml(这个是你先生成的xml文件目录) --output=h:\sample (这个是你要生成的持久化对象的目录)
rem Setup environment for hibernate tools
rem -------------------------------------------------------------------set JDBC_DRIVER=c:\mysql\mysql-connector-java-3.0.11-stable-bin.jar
set HIBERNATE_HOME=c:\hibernateset CORELIB=%HIBERNATE_HOME%\lib
set LIB=..\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%CORELIB%\commons-logging-1.0.3.jar;%CORELIB%\commons-collections-2.1.jar;%CORELIB%\commons-lang-1.0.1.jar;%CORELIB%\cglib-2.0-rc2.jar;%CORELIB%\dom4j-1.4.jar;%CORELIB%\odmg-3.0.jar;%CORELIB%\xml-apis.jar;%CORELIB%\xerces-2.4.0.jar;%CORELIB%\xalan-2.4.0.jar;%LIB%\jdom.jar;%LIB%\..\hibernate-tools.jar
@echo offrem -------------------------------------------------------------------
rem Setup environment for hibernate tools
rem -------------------------------------------------------------------set JDBC_DRIVER=D:\LIB\JTDS\jtds-0.8.1.jar
rem 数据库驱动程序目录
set HIBERNATE_HOME=D:\LIB\hibernate-2.1
rem hibernate目录set CORELIB=%HIBERNATE_HOME%\lib
set LIB=..\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=%JDBC_DRIVER%;%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%CORELIB%\commons-logging-1.0.4.jar;%CORELIB%\commons-collections-2.1.1.jar;%CORELIB%\commons-lang-1.0.1.jar;%CORELIB%\cglib-full-2.0.2.jar;%CORELIB%\dom4j-1.4.jar;%CORELIB%\odmg-3.0.jar;%CORELIB%\xml-apis.jar;%CORELIB%\xerces-2.4.0.jar;%CORELIB%\xalan-2.4.0.jar;%LIB%\jdom.jar;%LIB%\..\hibernate-tools.jar