It must allow the user to book a selected record, updating the database
file accordingly.
A record is considered booked when the field owner is set to a non-empty
String. Therefore, the expression "updating the the database accordingly" would imply updating the value of that column in the database.
This, as far as I am concerned, has nothing to do with the
delete flag, except for the fact that the
updateRecord method is responsible for making sure that the record is not deleted at the moment of performing the operation.
However, the update should not alter the value of the
delete flag at this time, because if the record is deleted it should throw
RecordNotFoundException.
The value of the
delete flag gets altered by two different methods, according to my specs:
1) A record is
set to deleted when the
deleteRecord method is invoked on it.
2) A record is
set to non-deleted when the
createRecord is invoked and there is a deleted record that can be reused instead of adding new records to the database.
As for the
findByCriteria method, it is not supposed to throw any specific checked exception, therefore you will have to create a mechanism to by-pass the deleted records while going over the whole file, searching for the provided criteria. In my case I have a method named somewhat like
isRecordDeleted that evaluates the
deletion flag on a record.
[ October 26, 2006: Message edited by: Edwin Dalorzo ]