Hello,
First off I am using hsqldb 1.7.2 and hibernate 2.1.4.

I do not want to set my unsaved-value to -1 in the <id> tag.  I would
like the unsaved-value to be 0.  However this causes a problem when I
use SchemaExportTask to create the database and tables for me.  The
identity columns are not created with a start value, so they defualt
to 0.  So the first ojbect I persist for each class is persisted with
a 0 value which is not desired.

I know I could just initialize all my id's to -1 and have the
unsaved-value be -1, but I don't wont to do that.  I would like to be
able to pass a <param> to the <generator> tag named "start" that will
start the indentity column with that value.  I went throught the
source and found that it will requrie a change to
HSQLDialect.getIdentityColumnString(), but I am unsure exactly how to
implement it.  Can anyone please advise?

Thanks,
Blake

//==================
// DESIRED
//==================
<hibernate-mapping>
    <class name="org.Foo" table="Foo">
        <id name="id" type="int" column="FOOID" unsaved-value="0" >
            <generator class="identity">
                  <param name="start">1</param>
            </generator>
        </id>       
    </class> 
</hibernate-mapping>


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to