Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on create() methond

 
fei lin
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my interface i have:
public int create(String [] data) throws DuplicateKeyException;

if i decided to use record number as my primary, I will always let user enter insert a row to db even though its same data(same name, location etc...) is it acceptable?
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is very acceptable to me.. There could be 2 "Bob Smith" in "Montreal"..

My decision was to not interfere with this. I thought, from reading the assignment, that there were no requirement asking for any restriction on this, so following that logic, I thought it would actually be wrong to do so.

But I've read others used some fields as the key as well. It's really of matter of making your own choice.

Regards,
Alex
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic