Java 使用 hibernate + jersey ws 进行 CRUD 操作

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24737785/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 14:34:11  来源:igfitidea点击:

CRUD operation using hibernate + jersey ws

javaweb-serviceshibernatemodeljersey

提问by Maforast

I have generated a model and dao with hibernate tools.

我已经用休眠工具生成了一个模型和 dao。

Now I would like to use the model and dao to make a query on a database using a restful web service with jersey.

现在我想使用模型和 dao 使用带有 jersey 的 Restful Web 服务对数据库进行查询。

Is it possible?

是否可以?

采纳答案by Bosko Mijin

Yes, it is possible. Check this question: REST with Java (JAX-RS) using Jersey.

对的,这是可能的。检查这个问题:REST with Java (JAX-RS) using Jersey

Generally, there are a lot of solutions, you have to search some. I think that most efficient for start is this one:

一般来说,有很多解决方案,你必须搜索一些。我认为最有效的开始是这个:

http://www.vogella.com/tutorials/REST/article.html

http://www.vogella.com/tutorials/REST/article.html

In that example you have a lot of information for creating everything including CRUD with Jersey in general.

在该示例中,您有很多信息可以创建所有内容,包括使用 Jersey 的 CRUD。

After that you can check this:

之后你可以检查这个:

http://persistentdesigns.com/wp/jersey-spring-and-jpa/

http://persistentdesigns.com/wp/jersey-spring-and-jpa/

There is explained process of integrating Jersey and JPA in spring.

有解释在春季整合 Jersey 和 JPA 的过程。

I hope that helps.

我希望这有帮助。