• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database modification

 
Pallav Grigo
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question about the modify(DataInfo info) method in the Data class. Which fields of the database are allowed to be modified by the client? The flight number and the number of free seats are definitely not to be modified directly since the first is the primary key and the latter is to be modified by the bookFlight() method. What if the administrator had to change some flight info such as the time or the duration or for that matter the origin/destination? Any response is appreciated.
Regards,
Pallav
 
Adam Roberts
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I remember correctly, pretty much any field can be changed by the client. Obviously, if you change the flight number, you won't be able to modify anything because the record can not be identified. All the method does is find the related DataInfo object, checks it, and replaces it with the one passed through the method.
Your bookFlights method will have to either modify the DataInfo then resend it, or create a new DataInfo based on the information in the old one with modified flight numbers.
Hope that helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic