This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

retrieving entire row in CMP  RSS feed

 
anupa oru
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
I would like to retrieve entire row from Database using CMP,would like to specify as business method so client can use the method on remote interface once they find bean instance.I would like to achieve something like select * from Table where id=122.
I also wanted to update entire row for CMP at once instead of calling multiple set methods,is there anyway to do this in CMP.I need to do in CMP something corresponds to SQL "update Table set id1=231 and id3=4334 where id=11".
I need answers for these tasks as soon as possible.
Thanks alot,
Anu
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37221
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anu,
Take a look at Sun's description of the Transfer object pattern.
 
anupa oru
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,
Thanks alot for your response.
Let me reframe my question, I am right now using DTOs also. I was wondering about once we get remote object using findByPrimaryKey,what about subsequent calls on remote object to get/set fields Are they remote calls or local calls.According to my understanding when we set/get fields on remote object we are actually doing on EJB container,container will write/read fields in its own fashion, am I on right track.
From client perspective how many times remote object created/looked up only determines performance for EJBS?is this appropriate assuption to make.
Let me know.
Thanks alot,
Anu
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anu,

Hi,

I was wondering about once we get remote object using findByPrimaryKey,what about subsequent calls on remote object to get/set fields Are they remote calls or local calls.According to my understanding when we set/get fields on remote object we are actually doing on EJB container,container will write/read fields in its own fashion, am I on right track.

Yes your assumption is right.
Before EJB2.0 and local interfaces, EJB designers used to employee the value objects design pattern (later on renamed the data transfer objects � how about that?!), which solves exactly the kind of problem you�re speaking about. This pattern is deprecated now because an usual EJB design follows the session fa�ade pattern and the entity beans layer is hidden to remote clients. Hence in theory the fa�ade will access the entity beans locally using the local interfaces and your get/set methods would result in local method calls.
If you don�t feel comfortable enough to build a session/message fa�ade than you should probably look at the value objects design pattern (as it was defined/deprecated for ejb 1.x).
Regards.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!