-->
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.  [ 1 post ] 
Author Message
 Post subject: 1-line suggested improvement for org.hibernate.type.EnumType
PostPosted: Tue Mar 03, 2009 3:19 pm 
Newbie

Joined: Tue Mar 03, 2009 2:58 pm
Posts: 10
Hibernate version: 3.2.4

One-line suggestion for org.hibernate.type.EnumType

At line 127, replace
Code:
String  name = (String ) object;
with
Code:
String name = object.toString();


Advantage: My DB column was a Postgres ENUM, and the retrieved object was a PGObject, not a String. However, Postgres can translate silently between a String and the matching ENUM in an INSERT or UPDATE without even a CAST.

Other than a tiny performance hit, I can't see a downside.


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

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.