-->
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.  [ 3 posts ] 
Author Message
 Post subject: errors talking with postgresql
PostPosted: Sun Dec 10, 2006 2:08 am 
Newbie

Joined: Mon Mar 27, 2006 7:46 pm
Posts: 17
I have been using hibernate for some time with hsqldb. I am migrating my application to postgresql. I have created the schema and just started trying to use my application with it. I am getting some odd errors:

2006-12-09 21:43:17 PST ERROR: column "test" does not exist at character 291
2006-12-09 21:43:17 PST STATEMENT: insert into COMPANY (VERSION, NAME, BILL_TYPE, EMAIL, WEBSITE, EIN, ETIN, ADMINISTRATIVE_CONTACT_NAME, ACTIVE, id) values (0, test, NULL, NULL, NULL, NULL, NULL, NULL, 1, 100000)
2006-12-09 21:43:36 PST ERROR: column "active" is of type boolean but expression is of type integer at character 104

This is very odd because test is a varchar yet if you look at the insert statement it is inserting it w/o being quoted. And I don't know why the active value is coming across as a 1 and not "true". The one thing it does do right is create the sequence id.

Here is my table:
CREATE SEQUENCE seq_company start 100000;
create table company(
id bigint PRIMARY KEY DEFAULT nextval('seq_company'),
name varchar not null,
ein varchar not null,
administrative_contact_name varchar,
email varchar,
website varchar,
etin varchar,
active boolean default true not null,
version integer);

Here is my mapping:

Code:
class name="Company" table="COMPANY" >
<!--        <cache usage="read-write"/>-->

        <id name="id" type="int" column="id" unsaved-value="-1" access="field">
            <generator class="sequence">
                <param name="sequence">SEQ_COMPANY</param>
            </generator>
        </id>
      <version  name="version" column="VERSION" unsaved-value="negative" access="field"/>
      <property name="name" column="NAME" not-null="true" type="string"/>
      <property name="billType" column="BILL_TYPE" type="string" not-null="false" />
      <property name="email" column="EMAIL" type="string" not-null="false"/>
      <property name="website" column="WEBSITE" type="string" not-null="false"/>
      <property name="ein" column="EIN" type="string" not-null="false"/>
      <property name="etin" column="ETIN" type="string" not-null="false"/>
      <property name="administrativeContactName" column="ADMINISTRATIVE_CONTACT_NAME" type="string" not-null="false" />
      <property name="active" column="ACTIVE" not-null="true" type="boolean"/>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Did you ever figure this out?
PostPosted: Fri Jan 19, 2007 2:25 pm 
Newbie

Joined: Thu Feb 16, 2006 12:38 pm
Posts: 2
Noticed, no one replied. We've been using Hibernate with Postgres on a project over a year now, just went live, and now are getting this same exact problem popping up. This isn't anything complicated. Simple types issues. object, schema and mapping are all correct, but getting 0 for boolean and unquoted string for insert. This was also tested and working for month's w/o any changes to any related code. Only change was going from postgres 8.0 to 8.1 Any insight is appreciated.


Last edited by tcrisera on Fri Jan 19, 2007 2:29 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Did you ever figure this out?
PostPosted: Fri Jan 19, 2007 2:25 pm 
Newbie

Joined: Thu Feb 16, 2006 12:38 pm
Posts: 2
Noticed, no one replied. We've been using Hibernate with Postgres on a project over a year now, just went live, and now are getting this same exact problem popping up. This isn't anything complicated. Simple types issues. object, schema and mapping are all correct, but getting 0 for boolean and unquoted string for insert. This was also tested and working for month's w/o any changes to any related code. Only change was going from postgres 8.0 to 8.1 Any insight is appreciated.


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