Hi,
Before using hibernate, I used to have first class domain objects without any database physical keys. And another class extending the first class domain objetcs will have physical keys.
Like Customer and CustomerDB. CustomerDB will have the customer_id
which is the primary key of the corresponding table "customer".
And also CustomerDB will have the necessary SQLs to insert/find/delete/update the Customer object to the database.
Since I am using the Hibernate now, and Hibernate does all these jobs for me, should I have the physical key also as part of domain object?. Hope I am not violating any design principle here.
-Moorsu.
|