简体   繁体   English

在Java EE应用中使用休眠

[英]Using hibernate in Java EE app

I am maintaining following structure for my project 我正在为我的项目维护以下结构

Web - Web Project Web-Web项目

Model - EJB Project 模型-EJB项目

Persistence - Java project having data classes and their mapping for Hibernate 持久性-具有Hibernate数据类及其映射的Java项目

Pokuri - EAR Project Pokuri-EAR项目

As we know we can give jar file to hibernate configuration to load mapping information from jar. 众所周知,我们可以给jar文件进行休眠配置,以从jar中加载映射信息。 As I deploy EAR on to server I just want to build SessionFactory from mapping files in Persistence jar. 在将EAR部署到服务器时,我只想从Persistence jar中的映射文件构建SessionFactory。 But I am unable to get the path for that jar. 但是我无法找到那个罐子的路。 Plz guide me to get the jar path. 请引导我获得jar路径。 Or suggest me the best way to build SessionFactory and bind the same to a JNDI name. 或建议我构建SessionFactory并将其绑定到JNDI名称的最佳方法。

Take a look at this thread - it may contain useful information. 看一下这个线程 -它可能包含有用的信息。

Also, make sure your jar is mapped in your application.xml as an ejb module. 另外,请确保您的jar作为ejb模块映射到application.xml中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM