-->
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: Identity type
PostPosted: Fri Feb 24, 2006 5:29 pm 
Newbie

Joined: Fri Feb 24, 2006 5:25 pm
Posts: 1
Greetings!

I am reading the 'Hibernate in Action' book. I found interesting that the book claims that any integer type (int, long, Integer, Long) is suitable for an indentity. Most of the exaples are using Long and I am curious is there any special reason for that (performance, serialization concerns, etc.).

Your help will be apreciated.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 26, 2006 3:11 pm 
Newbie

Joined: Tue Jan 25, 2005 3:03 am
Posts: 11
Location: Bangalore, India
Hi,

I believe that at the db-level, perf experts tend to recommend for the smallest integer type available, so as to take up the least space. However, that argument wouldn't make much sense at object-level. I don't see any reason why there should be any difference in performace as well. I think it is more of a convention.

I haven' t yet looked in to the hibernate code related to this, but I guess internally they would be using Long type universally.

Then again, that's just my 2 cents. ;-)

_________________
Rgds,
Vikas.

"Quidquid latine dictum sit, altum sonatur".
Whatever is said in Latin, sounds profound


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.