hibern8ide 配置使用- -
hibern8ide 作为hibernate的辅助工具,可以帮助我们调试HQL语句。
1。环境:
Ant 1.6.0
Ant 1.6.0
jdk 1.4
2。先下载ant 然后配置好 ANT_HOME 在PATH 中加入 %ANT_HOME%/bin
下载 hibernate 2.1
下载 hibernate-extensions-2.1.2 里面有hibern8ide2.1
将 hibernate2.1和hibernate-extensions-2.1.2 放到用级目录
3。编译运行hibern8ide
首先修改一下 build.xml 的22行,去掉/java目录,否则会报找不到这个目录
在运行 ant init
编译初始化 hibern8ide
ant run 运行
这里注意的是我把 jdbc的驱动放到了 hibern8ide/lib 目录下面,并将.zip文件改为.jar文件了,
您也可以自己手动修改 build.xml文件 将jdbc驱动加进去。
Hibern8IDE ? 使用(翻译害怕大家看不懂,就直接贴出来了)
If you write your Java code in the “HQL Commander” there is something you must know!
Java code: you can execute every kind of Java code, even not Hibernate-related! Whit this tool you can try your pieces of code quickly!
session: if you write java code you can use the “session” build-in object to interact with the underlying Hibernate session
commit: when you finish to manipulate data you can make a “session.flush()” and commit the changes with “session.connection().commit()”
import: if you use object that need import you can write your “imports” at the top of your code
output: the output window, below the code textfield, prints the “toString()” of the last value returned by the code (if not assigned); if this value is a Collection the output is one row for item:
if you execute “session.find(“from HUser”);” the output is the whole collection, one “HUser.toString()” each row; if you execute “List list=session.find(“from HUser”);“ no output is produced because the result is assigned to a variable, but you can write “list;“ on the second line of the code to see the list in the output window!
inspection: by double-clicking on an item in the output window you can inspect that object!
If you write your Java code in the “HQL Commander” there is something you must know!
Java code: you can execute every kind of Java code, even not Hibernate-related! Whit this tool you can try your pieces of code quickly!
session: if you write java code you can use the “session” build-in object to interact with the underlying Hibernate session
commit: when you finish to manipulate data you can make a “session.flush()” and commit the changes with “session.connection().commit()”
import: if you use object that need import you can write your “imports” at the top of your code
output: the output window, below the code textfield, prints the “toString()” of the last value returned by the code (if not assigned); if this value is a Collection the output is one row for item:
if you execute “session.find(“from HUser”);” the output is the whole collection, one “HUser.toString()” each row; if you execute “List list=session.find(“from HUser”);“ no output is produced because the result is assigned to a variable, but you can write “list;“ on the second line of the code to see the list in the output window!
inspection: by double-clicking on an item in the output window you can inspect that object!