-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Physical Keys with First Class Objects
PostPosted: Mon Feb 28, 2005 3:38 am 
Newbie

Joined: Mon Feb 28, 2005 3:22 am
Posts: 1
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 28, 2005 6:01 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Since Hibernate is all about POJO, you can easily remove second class.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.