pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: stagirus <mamasa@stagirus.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
Date: Tue, 28 Sep 2010 16:44:51 -0700 (PDT)
Message-ID: <1285717491749-2918544.post@n5.nabble.com> (raw)
In-Reply-To: <4CA18729.90401@postnewspapers.com.au>
References: <4CA064B50200002500035F29@gw.wicourts.gov>
	<1285601721239-2855475.post@n5.nabble.com>
	<4CA0805B0200002500035F43@gw.wicourts.gov>
	<4CA101E3.5080005@opencloud.com>
	<AANLkTi=OgduBWb4XLo3bqUXJULNEvUKCAh54xhiEgOjU@mail.gmail.com>
	<4CA1743F.2060301@postnewspapers.com.au>
	<4CA18729.90401@postnewspapers.com.au>


>>Are you using your own DDL to define your tables, so you're mapping
types as shorts in hibernate but using booleans in the database? Because
that's not how Hibernate expects it to be, it expects a short if you
tell it you're mapping a short.<<<

Craig: the scenario you have described is different from the one we are
facing.

1. Yes, we define and manage our own DDL, not generate from Hibernate. We
prefer to keep it that way.
2. We define the column in the database table as SMALLINT not boolean.
Please refer to my post below.
3. As described below, in the Hibernate we map Java boolean to DB SMALLINT.
Below I showed the mapping.
Obviously we assume java boolean values and DB integer values (columns) are
interchangeable. Poor "boolean" values have no real shape among DB vendors
and ANSI SQL.

I hope this makes sense.

Thanks. 


-- 
View this message in context: http://postgresql.1045698.n5.nabble.com/Re-BUGS-Mapping-Hibernate-boolean-to-smallint-Postgresql-tp2...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.



view thread (53+ messages)  latest in thread

Message-ID: <1285717491749-2918544.post@n5.nabble.com>
Permalink:  ../1285717491749-2918544.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1285717491749-2918544.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mamasa@stagirus.com
  Subject: Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
  In-Reply-To: <1285717491749-2918544.post@n5.nabble.com>
  References: <4CA064B50200002500035F29@gw.wicourts.gov> <1285601721239-2855475.post@n5.nabble.com> <4CA0805B0200002500035F43@gw.wicourts.gov> <4CA101E3.5080005@opencloud.com> <AANLkTi=OgduBWb4XLo3bqUXJULNEvUKCAh54xhiEgOjU@mail.gmail.com> <4CA1743F.2060301@postnewspapers.com.au> <4CA18729.90401@postnewspapers.com.au> <1285717491749-2918544.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox