1

I have generated a model and dao with hibernate tools.

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

Is it possible?

Andrew Stubbs
  • 4,322
  • 3
  • 29
  • 48
Maforast
  • 257
  • 1
  • 6
  • 17

1 Answers1

1

Yes, it is possible. Check this question: 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

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

After that you can check this:

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

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

I hope that helps.

Community
  • 1
  • 1
Bosko Mijin
  • 3,287
  • 3
  • 32
  • 45
  • I had just visit vogella's tutorials, I would like to know if there is a way to map, using hibernete model and dao resources, for use in jersey web service. – Maforast Jul 14 '14 at 14:44
  • As I said, general info is in vogella tutorial about CRUD. Working example of jersey, spring and jpa is given with third link. – Bosko Mijin Jul 14 '14 at 14:47
  • I use Hibernate tools for generating model and dao. You say that if I use Hibernate Jpa for use this object e make use of jersey I can do the job. Right? Hibernate jpa jar is different to other kind of hibernate jar? Also , can I use Jpa without spring? – Maforast Jul 14 '14 at 15:36