-->
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.  [ 4 posts ] 
Author Message
 Post subject: EnumType db-type guessing commmented out?
PostPosted: Wed Jan 25, 2006 5:48 pm 
Newbie

Joined: Sat Nov 19, 2005 8:07 pm
Posts: 8
I just downloaded the latest annotations beta (3.1beta8) and tried using the enum type in a regular, non-annotationed class (with hbm.xml). It was working fine right up until the enum property of a class was used in a query, at which point it blew up on me.

After a little poking around, I was suprised to find this in EnumType.java:

Code:
113:      public void nullSafeSet(...) throws ... {
114:         //if (!guessed) guessType( st, index );


Given that the sqlType is defaulted to Integer, it seems that if you're using a String backing sequence it will work up until it needs to set a value as a bind parameter.

I guess what I'm really wondering is, is there a reason this got commented out? Is this no longer needed if you're running using an AnnotationConfiguration? I've worked around it for now using the 'type' parameter to EnumType. Thanks,[/code]

_________________
-Tim Fennell
Stripes: Because web development should just be easier.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 8:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
guessing is fucked up in some databases (including expensive ones) because of lack of decent JDBC metadata support.
Open a JIRA issue with a reproducable test case.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 25, 2006 10:06 pm 
Newbie

Joined: Sat Nov 19, 2005 8:07 pm
Posts: 8
emmanuel wrote:
guessing is fucked up in some databases (including expensive ones) because of lack of decent JDBC metadata support.
Open a JIRA issue with a reproducable test case.


Emmanuel: I'm a little confused. Are you saying that the code is commented out because it causes problems with some JDBC drivers? My problem isn't that the guessing code doesn't work on my DB (it's Oracle...I submitted the patch to make it Oracle friendly), it's that in the latest build the code that should invoke the guessing is commented out.

If you like I can submit a JIRA bug for this. A standalone test case would be a significant amount of work...but a patch, that'd be easy ;)

_________________
-Tim Fennell
Stripes: Because web development should just be easier.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:22 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
guessType shouldn't be required anymore as per the spec becasue of the @Enumerated(STRING) annotation.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.