You addressed it to the wrong guy.  No worries though.

On 2004-Apr-08 00:04, David Friedman wrote:
> Nick,
> 
> Your problem is the "type" set in your <id.../> tag.  From (RTFM) the page:
> http://www.hibernate.org/hib_docs/reference/html/or-mapping.html#or-mapping-
> s1-4--generator
> 
> See the "identity" description, which reads:
> 
> > identity - supports identity columns in DB2, MySQL,
> > MS SQL Server, Sybase and HypersonicSQL. The returned
> > identifier is of type long, short or int.
> 
> The issue is your attempted use of class "java.lang.Long" instead of of
> "long", "short", or "int".  I had a similar problem months ago when I
> started using Hibernate, until I re-read that primer.
> 
> Also, you may wish to set your generator from "identity" to "native".  That
> way, if you switch database products, it will automatically figure out if it
> can use identity, sequence, or hilo. (see the same document section just a
> few lines lower under the "native" explanation)
> 
> Regards,
> David
> 
> > <hibernate-mapping>
> >    <class name="com.edhand.hibernate1.Item" table="item" >
> >        <id name="id" column="id" type="java.lang.Long" unsaved-value="0">
> >            <generator class="identity"/>
> >        </id>
> >        <property name="name" column="name" type="java.lang.String" />
> >        <property name="description" column="description"
> > type="java.lang.String" />
> >    </class>
> > </hibernate-mapping>
> >
> 
> -----Original Message-----
> From: Nick Heudecker [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 07, 2004 11:42 PM
> To: Struts Users Mailing List
> Subject: Re: Struts and Hibernate
> 
> 
> The next thing I'll suggest is changing your mapping to:
> 
> <id name="id" column="id" type="java.lang.Long" unsaved-value="null">
> 
> If that still doesn't work, your best bet is to hit the
> Hibernate forums: http://forum.hibernate.org/
> 
> 
> >
> > <hibernate-mapping>
> >    <class name="com.edhand.hibernate1.Item" table="item" >
> >        <id name="id" column="id" type="java.lang.Long" unsaved-value="0">
> >            <generator class="identity"/>
> >        </id>
> >        <property name="name" column="name" type="java.lang.String" />
> >        <property name="description" column="description"
> > type="java.lang.String" />
> >    </class>
> > </hibernate-mapping>
> >
> > Tried both native and identity without succes.
> >
> >
> > --
> > _________________
> > Mario St-Gelais
> > www.gestionti.com
> > "Good judgment comes from
> > experience- usually experience
> > which was the result of poor judgment"
> > Bill Putnam
> 
> --
> Nick Heudecker
> System Mobile, Inc.
> Email: [EMAIL PROTECTED]
> Web: http://www.systemmobile.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Nick Heudecker
System Mobile, Inc.
Email: [EMAIL PROTECTED]
Web: http://www.systemmobile.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to