I'm designing an application that will allow putting some data in the database. I wanted to somehow reflect the database structure in the application, for example if i have a table where there are departments and a table with employees and there is a department with id 3 and two employees related to him with ids 44 and 123, in my application there would be a class Department with a property Id set to 3 and it would have a reference to two Employee classes with Id's set to 44 and 123.
I talked to my coworker about it and he said that i shouldn't be reflecting the database structure in the application - the application should know nothing about the data source. it sounds quite clever but if i won't have Id properties in my classes (and they certainly reflect the database structure) it's impossible that I could know which employee's properties were changed and I won't be able to put data back in database. I'm confused - I've heard about frameworks to reflect database structure as objects (hibernate for example) and I'm not really sure if it is so bad.
what do you think?