Where to place hibernate.cfg.xml?

前端 未结 9 882
渐次进展
渐次进展 2020-12-02 22:40

My project is like this:

/src/main/java
     -thegamers
         -app.java
         -hibernateutil.java

can someone tell me where to put th

9条回答
  •  孤城傲影
    2020-12-02 22:42

    if it is not web project then do explicitly like that

    new Configuration().configure( "pth/to/hibernate.cfg.xml").buildsessionfactory()
    

    Hope this may help

    @SiB pointed a link(mkyong's web site). It is explained well there.

提交回复
热议问题