• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

How to migrate CMP Entity Benas to Spring?

 
Greenhorn
Posts: 6
IBM DB2 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

My projects uses few "Container Managed Persistent Entity Beans" and Message Driven Beans. My task is to remove EJBs and migrate them to Spring. I'm able to migrate MDBs to MDPs. Is there any way to migrate CMP entity beans to Spring? I googled for solution, but no luck.

Can anyone help me here?

Regards
Siva Krishna. K.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two questions...

First, is there a preferred persistence framework being used? Spring is really just the IOC framework - it delegates to other things for persistence - like direct JDBC, Hibernate, iBatis, etc. So you're not really going to migrate your EJB to "Spring" to do this, but migrate it to one of the persistence frameworks and then wire up connections between it and the rest of your app using Spring. Spring does supply classes like HibernateDaoSupport, JDBCDaoSupport, etc. for working with these persistence technologies through Spring.

Second, is it EJB 2.1, EJB 3.0, etc.? If it's 2.1 it's going to be more of a conversion process. If it's 3.0 you can re-use JPA annotated model objects through another JPA provider (such as Hibernate or TopLink) and use Spring's EntityManagerFactory.
 
Siva Krishna
Greenhorn
Posts: 6
IBM DB2 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Nathan,

1. As of now we are not using any ORM.
2. We are using EBJ 2.1.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK - since you don't have an existing persistence mechanism in place - I'd suggest using something that supports JPA. It's a lot simpler than the alternatives, you just annotate classes with the tables they map to, and annotate methods/fields with the columns they map to. Theres a guide to Getting Started With JPA in Spring - it uses TopLink, but it's pretty trivial getting it to work in Hibernate.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic