首页 > 学院 > 开发设计 > 正文

由POJO生成Hibernate映射文件的批处理程序

2019-11-18 11:22:22
字体:
来源:转载
供稿:网友

setenv.bat
-------------------------------------------
@echo off

set HIBERNATE_LIB=D:/lib/hibernate
set CLASS_ROOT=D:/work/hibernate_test1/classes

set CP=%CLASS_ROOT%;./;%HIBERNATE_LIB%/hibernate-tools.jar;%HIBERNATE_LIB%/hibernate2.jar;%HIBERNATE_LIB%/commons-logging-1.0.4.jar;



class2hbm.bat
--------------------------------------------
@echo off
call d:/bat/setenv.bat
java -cp %CP% net.sf.hibernate.tool.class2hbm.MapGenerator --output=%CLASS_ROOT%/%1.hbm.xml %2

 

 

----------------------

使用前要手工修改setenv.bat中的HIBERNATE_LIB和CLASS_ROOT
使用方法:
class2hbm foo full.class.name



发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表