| Author |
CMP and JPA
|
Chaminda Amarasinghe
Ranch Hand
Joined: May 17, 2006
Posts: 402
|
|
Hi Guys,
Can we combine CMP and JPA (use them in same time)
Regards
|
 |
Rishi Shehrawat
Ranch Hand
Joined: Aug 11, 2010
Posts: 218
|
|
|
It can be done, but is not recommended
|
 |
Ranganathan Kaliyur Mannar
Bartender
Joined: Oct 16, 2003
Posts: 949
|
|
why would you?
in fact, in 3.0, JPA can replace CMP. If you write a EJB 2.1 BMP, you would be actually writing all the insert/update/delete query yourself. In CMP, you were required to just 'set' the values - for deleting, you would use 'remove' method. In JPA too, you create the object, 'set' the values and call 'entityManager.persist()' or 'entitymanager.remove()'. So, they are very similar...
|
Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
|
 |
Chaminda Amarasinghe
Ranch Hand
Joined: May 17, 2006
Posts: 402
|
|
This is a question for a simulator
Regards
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26499
|
|
|
Yes. It is valid to have existing CMP code and new JPA code in the same application. This is a common migration scenario.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Chaminda Amarasinghe
Ranch Hand
Joined: May 17, 2006
Posts: 402
|
|
|
Thanks Guys
|
 |
 |
|
|
subject: CMP and JPA
|
|
|