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>