• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to migrate CMP Entity Benas to Spring?

 
Siva Krishna
Greenhorn
Posts: 5
IBM DB2 Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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: 5
IBM DB2 Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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 Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic