• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

confused with JAP,Hibernate

 
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dearl all,
I am getting confusion,that JPA will make our POJO's are persistence with annotations,Right?if we are not using annotations in hibernate lets say using only xml files,then is it psossible to use JPA?
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. You can mention all the mappings in the persistence.xml file in JPA.
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot,lets say i am not using JAP at all only hibernate,then our POJO's not persistent pojo's?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, you'll have to remember that JPA is not JAP You don't need to use JPA to make your pojos persistent in Hibernate. Hibernate is one persistence framework, which happens to also be an implementation of JPA. Check this article about Hibernate 3.5 without JPA.
 
Reddy Prashanth
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Hibernate is an ORM framework by its own and also it supports JPA specification. You dont need to use JPA if you dont want. Hibernate will persists your POJOs.

So you can use Hibernate as it is or you can use JPA in your application, leveraging hibernate's JPA implementation.
In hibernate applications, we mention pojo-table mapping details in *.hbm files or use Hibernate annotations.
In JPA, we mention the mappings in perssitence.xml or use JPA annotations.

JPA annotations are subset of hibernate annotations.
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot guys,at last one doubt,in what kind of scenario we will go for JPA ,even though our Framework is Persistence framework?
 
Reddy Prashanth
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want portability for your application across different JPA implementations and do not want to couple your application with Hibernate api, you can use JPA. Also, it is alway a good idea to use JPA. But hibernate has some additional features which are not part of JPA specification (ex: Criteria Queries and Query By Exmaple)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic