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

update strategy

 
uzma ali
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did the find by Criteria. As name and the location are the fields to put the search on , so there are number of records returned and name and location are repeated in many records.

Now update starategy.

The user clicks one of the record which he wants , I'll store all the fields in an array and find the record by find method(not findByCriteria as this time we have more fields)

My question is here can I add another find method in Data.java, which is not mentioned in the DBAccess inteface, I think we can but just watned to be sure and want your opinion.

After finding the record I'll lock the record and do the find again and match with the old values to be sure that the record has not been changed.

The lock method will generate the Lock cookie with which I'll call the update method. What this lock cookie is for by the way. Are we suppose to store it somewhere other than calling the update(). Please comment

When the record is matched then I do the update or book it with CustomerID.

the last method would be to unlock.

Please suggest about my understanding

Any advice is appreciated

thanks

Uzma
 
Anne Crace
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added another interface, MyDBAccess, that extends DBAccess, and had Data implement both of them. I add any additional functionality to MyDBAccess. Hope this helps. I am stuck on findByCriteria(String[] criteria) right now myself.
 
uzma ali
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks

Didu have a separate method of find in your new interface. Let me know what your additional interface is doing.

Also if you need help in findByCriteria(), let me know

Thanks

uzma
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic