Skip site navigation (1) Skip section navigation (2)

Re: smallint vs. boolean (was invalid string enlargement

From: Glenn Holmer <gholmer(at)weycogroup(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: smallint vs. boolean (was invalid string enlargement
Date: 2005-04-12 17:05:30
Message-ID: 1113325530.26370.50.camel@shadow.weycogroup.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
On Fri, 2005-03-18 at 09:37 +1300, Oliver Jowett wrote:
> Glenn Holmer wrote:
> 
> > We can't upgrade the driver because we get this:
> > 
> > 2005-03-17 10:10:22,961 WARN  
> > net.sf.hibernate.util.JDBCExceptionReporter - Meth
> > od: logExceptions - Line: 38  Message: SQL Error: 0, SQLState: 42883
> > 2005-03-17 10:10:22,962 ERROR 
> > net.sf.hibernate.util.JDBCExceptionReporter - Meth
> > od: logExceptions - Line: 46  Message: ERROR: operator does not exist: 
> > smallint = boolean
> 
> Without more details I'd have to say this is a hibernate or schema 
> mapping bug -- it looks like it is using setBoolean() where you should 
> be using setShort() (or vice versa). This only shows up in newer drivers 
> because they more tightly bind types to parameters (due to using the V3 
> extended query protocol to pass parameters to the server)
> 
> This behaviour is unlikely to change, so you might want to look at 
> tracking down the cause. As a last resort, you might be able to create 
> implicit casts between smallint<->boolean.

Yes, the database has some fields defined as smallint and set to 0 for
false or either 1 for true; the Hibernate DTOs have these fields
declared as boolean.

Is there any way around this without rewriting everything?

-- 
____________________________________________________________
Glenn Holmer                          gholmer(at)weycogroup(dot)com
Software Engineer                        phone: 414-908-1809
Weyco Group, Inc.                          fax: 414-908-1601



In response to

Responses

pgsql-jdbc by date

Next:From: VernonDate: 2005-04-12 17:06:43
Subject: Data type for array of byte
Previous:From: Guillaume CottenceauDate: 2005-04-12 10:54:23
Subject: Re: java connection closing itself

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group