在hibernate-examples这里可以看到,非常不错的
以前我看了别人的例子还是没有搞懂应该如何配置,这里就很清楚了
初学者值得推荐
收到~ 谢了~
看到了,可惜还没有好好的理解。另外字词有点错,好象有点匆忙的感忙(觉得奇怪)。
例子不够复杂呀,
我怎么也找不到关于Hibernate 继承和多态的例子, 不知大家是否知道?
请告之,谢谢!
这个算不算?
http://hibernate.bluemars.net/hib_docs/reference/html/examples.html
哦,对了,顺便问个问题,如果太菜了,欢迎拍砖,但还希望不吝赐教。
如例子中的Cat,是不是配置好了后,数据库表会自动生成?不用自己手工建立吧?
当然是你自己建立表了
-_-b
hbm都已经说得那么明显了,还不能自动建吗?有什么关键难点不?
sorry,应该是可以的
例子
SchemaExport dbExport=new SchemaExport(conf);
dbExport.setOutputFile("build\\sql.txt");
dbExport.create(true, true);
说明
public void create(boolean script,
boolean export)
throws HibernateException
Run the schema creation script.
Parameters:
script - print the DDL to the console
export - export the script to the database
Hibernate的例子吗?
xpetstore
appfuse
polls
resume
Thanks! 看样子,这是要看一些不愿看的代码了。
BTW,
<<如例子中的Cat,是不是配置好了后,数据库表会自动生成?不用自己手工建立吧?<<
首先自已建库,并且在hibernate.property中设置库,然后就可以用以上代码自动生成表了。