Any idea why I am getting the following when I try to run our hibernate app on linux against Postgres 7.4.1?
Code:
[RMI TCP Connection(6)-10.0.0.205] [2004-02-11 18:05:44,328] INFO - hibernate.database=postgres
[RMI TCP Connection(6)-10.0.0.205] [2004-02-11 18:05:44,376] DEBUG - Creating Hibernate configuration from prop resource hibernate_ejb_postgres.properties
[RMI TCP Connection(6)-10.0.0.205] [2004-02-11 18:05:45,452] DEBUG - Configured Hibernate configuration
[RMI TCP Connection(6)-10.0.0.205] [2004-02-11 18:05:47,209] ERROR - Unsuccessful: create table Task (id BIGINT NOT NULL AUTO_INCREMENT, class VARCHAR(255) not null, startRecord INTEGER, endRecord INTEGER, status SMALLINT, job_id BIGINT not null, sourcelist_id BIGINT, primary key (id))
[RMI TCP Connection(6)-10.0.0.205] [2004-02-11 18:05:47,209] ERROR - ERROR: syntax error at or near "AUTO_INCREMENT"
[RMI TCP Connection(6)-10.0.0.205] [2004-02-11 18:05:47,212] ERROR - Unsuccessful: create table Campaign (id BIGINT NOT NULL AUTO_INCREMENT, name VARCHAR(255), client_id BIGINT not null, primary key (id))
[RMI TCP Connection(6)-10.0.0.205] [2004-02-11 18:05:47,212] ERROR - ERROR: syntax error at or near "AUTO_INCREMENT"
And so forth and so on....
This is with the pg74.1jdbc3.jar Postgres driver, and this Hibernate configuration:
Code:
hibernate.connection.datasource jdbc_1
hibernate.dialect net.sf.hibernate.dialect.MySQLDialect
hibernate.show_sql false
hibernate.transaction.factory_class net.sf.hibernate.transaction.JTATransactionFactory
jta.UserTransaction java:comp/UserTransaction
hibernate.jdbc.batch_size 0
hibernate.hbm2ddl.auto create
We are using the following app server data source configuration:
Code:
datasource.name jdbc_1
datasource.url jdbc:postgresql://barracuda3/barracuda_test
datasource.classname org.postgresql.Driver
datasource.username postgres
datasource.password
datasource.mapper rdb.postgres
If I run the following SQL against the database by hand (using DbVisualizer 4.03 -- love it! -- and the exact same driver and jdbc URL), I get the same error:
create table Campaign (id BIGINT NOT NULL AUTO_INCREMENT, name VARCHAR(255), client_id BIGINT not null, primary key (id))
But sure enough, *this* SQL succeeds:
create table Campaign (id BIGINT NOT NULL, name VARCHAR(255), client_id BIGINT not null, primary key (id))
Here's the mapping:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.nimblefish.core.data.Campaign">
<id name="id" type="long" unsaved-value="null" >
<generator class="native"/>
</id>
<property name="name" type="string"/>
<many-to-one name="client" column="client_id" not-null="true"
class="com.nimblefish.core.data.Client"/>
<set name="sourceLists" inverse="true" cascade="all-delete-orphan" lazy="true">
<key column="campaign_id"/>
<one-to-many class="com.nimblefish.core.data.SourceList"/>
</set>
<set name="campaignLists" inverse="true" cascade="all-delete-orphan" lazy="true">
<key column="campaign_id"/>
<one-to-many class="com.nimblefish.core.data.CampaignList"/>
</set>
<set name="workRequests" inverse="true" cascade="all-delete-orphan" lazy="true">
<key column="campaign_id"/>
<one-to-many class="com.nimblefish.core.data.WorkRequest"/>
</set>
<!-- don't set inverse="true" on lists since the parent needs to maintain the index! -->
<list name="jobDescriptions" cascade="all-delete-orphan" lazy="true">
<key column="campaign_id"/>
<index column="campaign_index"/>
<one-to-many class="com.nimblefish.core.data.JobDescription"/>
</list>
</class>
</hibernate-mapping>
What simple, obvious, brain-deadeningly clear thing am I, a newbie, missing?
Thanks very much --
cheers! --
Rob