This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using ORM Data Access in Spring Framework

 
Tariq Ahsan
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • 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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic