[Hibernate-JIRA] Created: (HHH-2453) Inserting BIT to PostgreSQL table
by Imran M Yousuf (JIRA)
Inserting BIT to PostgreSQL table
---------------------------------
Key: HHH-2453
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2453
Project: Hibernate3
Type: Bug
Components: query-sql
Environment: Not sure about the hibernate version but will add it soon, downloaded last June. PostrgreSQL 8.2.3 on RedHat Fedora Core 1. Spring Framework.
Reporter: Imran M Yousuf
Attachments: CallUser.hbm.xml, hibernate_pgsql.properties
I created a Table which has a column active as Boolean in the entity and the HBM file specifies the type as boolean. When I use this configuration with MySQL it works fine, but when I use it with PostgreSQL I get an javax.sql.BatchUpdateException. so later I changed the HBM file 'active' column type to 'yes_no' and than it works fine. So I confirmed that the problem is due to the BIT(1) column.
So I next tried to manually insert into the column and it PgSQL tells that 1 needs to be casted. Please let me know if I can help in other ways, I will be most grateful to help.
Thank you,
Imran
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
16 years, 1 month
[Hibernate-JIRA] Resolved: (HHH-1587) 'true' and 'false' as keywords for PostgreSQL dialect
by Diego Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1587?page=c... ]
Diego Plentz resolved HHH-1587.
-------------------------------
Assignee: Diego Plentz
Resolution: Cannot Reproduce
Etienne, I created a project to reproduce your problem(using hibernate 3.2.6, postgre 8.3 and PostgreSQLDialect), but it works as expected. Create a testcase if you still having this problem.
public void find(){
getSession().createQuery("from Person p where p.active = true").list();
}
Generates:
select
person0_.id as id0_,
person0_.active as active0_
from
Person person0_
where
person0_.active=true
> 'true' and 'false' as keywords for PostgreSQL dialect
> -----------------------------------------------------
>
> Key: HHH-1587
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1587
> Project: Hibernate3
> Issue Type: Improvement
> Reporter: Etienne Bernard
> Assignee: Diego Plentz
> Priority: Minor
>
> I'm using the PostgreSQL dialect with hibernate 3.1.
> I tried to add a ' where="active=true" ' restriction on my collection mapping.
> Unfortunately, it was incorrectly interpreted as a column name by the query parser :
> FROM es.vodafone.tienda.model.Phone AS p JOIN p.activePhonePacks AS pp
> WHERE p.active=true
> where rewritten as :
> select phone0_.id as col_0_0_, activephon1_.id as col_1_0_ from phone phone0_ inner join phonepack activephon1_ on phone0_.id=activephon1_.phone and activephon1_.active=activephon1_.true where phone0_.active=true
> The solution seems to register "true" and "false" as keywords in the PostgreSQL dialect :
> registerKeyword("true");
> registerKeyword("false");
> Thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 1 month