Java hibernate eclipse bin directory
I am using hibernate and put xml mapping files in src/hib directory. but when debug application eclipse run directory is bin. Is possible to forse Eclipse also copy .xml files o开发者_Python百科f mapping also to bin/hib directory? Thanks.
Eclipse should do it automatically. The problem is that Hibernate, by default, loads its config file from the default package, and not from the hib
package.
Notice that it doesn't load it by opening a file, from the current directory. It loads it as a resource from the classpath. Even if the config file ends up in a jar file, Hibernate will be able to load it, provided it is at the expected location in the package tree (i.e. at the root of the tree).
精彩评论