I am just staring on my B&S (2.2.2) assignement and can't answer your question,however, I was just curious as to what scenario do you need to compare two instances of the Contractor object ?
posted 11 years ago
I have a Transfer object which contains the complete data for a single record. In a standalone environment, the possibility of creating the same record is almost zero. But in distributed environment, there might be a chance of getting multiple copies of the same record. Each copy will be deserialized into separate instantiation of the Transfer Object class. So here I need to differentiate the two objects hence I have overridden the equals & hashcode methods. The hashcode must be implemented correctly if the Transfer Object is used as key in hash based collections.
Hi Satishkumar, I think you are doing more than the requirements, there is no requirement for the GUI to have functionality to create a new record, so why do you need to carry the object to the server.
I am working on a different assignment, but I just use the record id for the equals method. This makes things realy easy. However, in my assignment (URLyBird 1.3.2) two records are not equal if all data in the record is the same. I don't know if this is also the case for your data model, e.g. two contractors with the same name, location and speciality that are actually two different records in the db.
0x2B | ~0x2B
SCJD, SCJP 1.5, SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJA, IBM Test 150, 142, 700, 701, Oracle Test 1Z0-51
in my opinion; the record id is enough to uniqualy identify the contractor.
what you think guys ?
posted 11 years ago
Thanks all of you for posting your comments on this issue. Record ID is enough to identify the record provided the records position not changed in the db. If the records are added in the middle or deleted in the middle, we need to identify the record uniquely by concatenating name, location and speciality etc.
I want my playground back. Here, I'll give you this tiny ad for it:
Devious Experiments for a Truly Passive Greenhouse!