An update to this bug:
Turned on debugging to see that its inserting the ids appropriately for every table except for Exs, as seen in the stack trace below.
Code:
Hibernate: insert into EmailData (rawHeader, rawBody, recommendation, subject, date, viewed, htmlURI, textURI, headerURI, EDID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into AddressEmails (EMID, EDID) values (?, ?)
Hibernate: insert into EmailSender (EMID, EDID) values (?, ?)
Hibernate: insert into EmailSellerDomainRels (SDRID, EDID) values (?, ?)
Hibernate: insert into Exs (viewed, date) values (?, ?)
2007-10-25 11:30:35,462 WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 0, SQLState: 23502
2007-10-25 11:30:35,462 ERROR [org.hibernate.util.JDBCExceptionReporter] - ERROR: null value in column "exid" violates not-null constraint
etc...
Moved down to Postgres 7.4, moved JDBC driver down too
Triple checked that I was using Postgres Dialect
Moved up to Hibernate 3.2.5ga.
And still having issues :(. Is there any reason why Hibernate would not be inserting the exid in this situation? Here is the Ex mapping:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.appleface.sbx.model.sbxdb.hibernate.Ex" table="Exs" batch-size="5">
<id name="id" column="EXID">
<generator class="identity"/>
</id>
<property name="viewed" type="boolean"/>
<property name="date" type="timestamp"/>
<set name="emailData" table="ExEmailData" >
<key column="EXID"></key>
<many-to-many
class="com.appleface.sbx.model.sbxdb.hibernate.EmailData"
column="EDID"
unique="true"/>
</set>
<set name="receipts" table="ExReceipts" >
<key column="EXID"></key>
<many-to-many
class="com.appleface.sbx.model.sbxdb.hibernate.Receipt"
column="RID"
unique="true"/>
</set>
<set name="itemPhotoRelationships" table="ExItemPhotoRels" inverse="true">
<key column="EXID"></key>
<many-to-many
class="com.appleface.sbx.model.sbxdb.hibernate.ItemPhotoRelationship"
column="IPRID"
unique="true"/>
</set>
<join table="ExSellerDomainRels" >
<key column="EXID"/>
<many-to-one name="sellerDomainRelationship"
column="SDRID"
not-null="true"
class="com.appleface.sbx.model.sbxdb.hibernate.SellerDomainRelationship"/>
</join>
<join table="UserExs">
<key column="EXID"/>
<many-to-one name="user"
column="UID"
/>
</join>
</class>
</hibernate-mapping>