为什么会休眠忽略package-info.java? [英] Why would Hibernate ignore package-info.java?
问题描述
我试图使用Hibernate @TypeDef标注在包装的水平,正是因为它的的 Hibernate文档。
我使用休眠3.6
和春3.0.7
。在code编译和包info.class
在classpath中,但它仍然是不通过Hibernate看到。
I'm trying to use Hibernate @TypeDef annotation on a package level, exactly as it is described in the Hibernate documentation.
I'm using Hibernate 3.6
and Spring 3.0.7
. The code compiles and the package-info.class
is in the classpath, but still it is not seen by the Hibernate.
如果我把 @TypeDef
上的一流水平,它的工作,但如果我把没有在封装信息
。我试图谷歌,但找不到任何有用的。
If I put @TypeDef
on the class level, it's working, but not if I put in the package-info
. I tried to google but couldn't find anything helpful.
感谢您!
推荐答案
您可能需要添加一个
<resource package="com.foo.bar.thepackage"/>
要你的Hibernate配置文件,或致电<一个href=\"http://docs.jboss.org/hibernate/core/3.6/javadocs/org/hibernate/cfg/Configuration.html#addPackage%28java.lang.String%29\">configuration.addPackage(\"com.foo.bar.thepackage\").
to your Hibernate config file, or to call configuration.addPackage("com.foo.bar.thepackage").
这篇关于为什么会休眠忽略package-info.java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!