Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql)
От | stagirus |
---|---|
Тема | Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql) |
Дата | |
Msg-id | 1285717491749-2918544.post@n5.nabble.com обсуждение исходный текст |
Ответ на | Re: [BUGS] Mapping Hibernate boolean to smallint(Postgresql) (Craig Ringer <craig@postnewspapers.com.au>) |
Список | pgsql-jdbc |
>>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-tp2855367p2918544.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
В списке pgsql-jdbc по дате отправления: