• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Using ORM Data Access in Spring Framework

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everyone!

I was wondering if anyone could point me to some simple codes along with configuration setups that uses specifically ORM data access of JPA, EntityManagerFactory, EntityManager etc. to do a database transaction in the Spring Framework. I already have some existing entity POJOs which is been used using JPA to do database transactions under the JBoss Seam Framework. I want to use those entities in the Spring Framework code. By the way do I need to have all these on an application server like to do a simple run? Or I can just execute the code with a client app?

Thanks
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Docs
http://static.springsource.org/spring/docs/2.5.x/reference/orm.html

A little old, but still valid
http://blog.springsource.com/2006/05/30/getting-started-with-jpa-in-spring-20/

Basically you configure a TransactionManager which you pass the EntityManagerFactory configuration bean, in that you include the list of Annotated beans or xml mapping files.

You also need a DataSource.

In the short and sweet version that is all you really need. You can have a persistence.xml file if you want or not.

Mark
 
Tariq Ahsan
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Mark!!! I'll check out those links.
 
Tariq Ahsan
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One other thing. Is it possible to get a source where I can get a sample codes specifically using JPA, EntityManager?

Thanks
 
Shiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic