• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

deleted flag in string array in B&S

 
pramod karnani
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have question regarding for deleted flag and string data array.

create and update method both accepts String[] data array as arguments ,

What will be elements of String [] data array ?

data[0]=Subcontractor Name
data[1]=city
data[2]=specialties
data[3]=size
data[4]=rate
data[5]=owner



but where the deleted flag will go ?

or data array will be like that

data[0]=deleted flag value
data[1]=Subcontractor Name
data[2]=city
data[3]=specialties
data[4]=size
data[5]=rate
data[6]=owner value



When sun tester will do testing of create /update method will they specify deleted flag as element of String[] data array?
If yes then what value they specify for deleted flag ?

like this
data[0]=deleted flag value ("" empty string)


Regards,
Pramod

 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Pramod!

The deleted flag isn't really an element of the String array when you are either creating or updating a record. If you are creating a record, its flag should implicitly be set to the valid value; if you are updating it, then it must be a valid record (otherwise, a RecordNotFoundException should be thrown), so its flag should already be valid.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi pramod

Like the great and very wise Roberto already said, i don't think you should add the delete flag in the string array, because it's not a part of a contractor record. It just indicates if a record is deleted or not. The only values in the String array should be the 6 you mentioned first.

It would be a bit crazy and weird if you want to create a new contractor and you have to provide a deleted flag as first element of your array. And if you check the interface you have to implement, you see eg following method

So if you had to pass the deleted flag too, it would be mentioned here.

I believe the sun tester will pass an array containing values for the fields mentioned in the "Database schema"-section of your assignment (for me 7 fields, for you apperently just 6). He might also pass an array with only 3 (or maybe 10) values to see how you handle that, maybe he is a bit sneaky and passes also a null-array,... but certainly not a deleted flag as the first element

Kind regards,
Roel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic