SCJP 5<br />SCJD
Jens Voß
SCJP 5.0 (97%), SCJD (98%), SCWCD (92%)
SCJP 5.0
Originally posted by Jim Petersson:
I chose to use name + location as a primary key. Of course this has to be mentioned in the choices file. I guess this is one of those cases were you need to make a design decision for yourself.
_ _ ________________________ _ _ <br /> <br />Just SCJP (but 93%)
Originally posted by Joshua Fix:
I just call my find(String[]) method on the data that was passed in to the create method. It in turn attempts to match every field of a record to the fields of the record that is trying to be created.
If any matches are returned, then there is an entry with all the same values. In that case, I throw a DuplicateKeyException.
_ _ ________________________ _ _ <br /> <br />Just SCJP (but 93%)
Originally posted by Ewan Livingstone:
I don't see any way in which there could ever be any circumstance in which one cannot insert a record because the ID/key already exists.
Am I missing something?
_ _ ________________________ _ _ <br /> <br />Just SCJP (but 93%)
Again: why shouldn't hotel "Palace" in "Sometown" have two (or more) rooms in the offering on the same date, for the same price, and both non-smoking? It's a hotel, so they're expected to have many rooms available!
I think the only valid key is the record number. There is no reason to say that two records are not allowed to have all fields equal.
SCJP 5.0
SCJP 1.2; SCWCD 1.2,1.4; SCBCD 1.3; SCJD 5.0
Originally posted by rinke hoekstra:
Supposing you are talking about urlybird:
I wouldn't do that. What makes you think that each hotel just has exactly one room to offer? I didn't think that very likely. It is more likely that, when a hotel is a customer of urlybird, they may have several rooms in the offering, and two rooms may even have exactly the same field values. Why shouldn't a hotel have two rooms available on the same date, both non-smoking, for the same price?
SCJP 5<br />SCJD
Originally posted by Joshua Fix:
I am working on B&S. For me, it seemed too unlikely that two businesses with the same name are in the same city that offer the same specialties and have the same number of employees and same rate.
_ _ ________________________ _ _ <br /> <br />Just SCJP (but 93%)
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |