You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Genís Pujol <gp...@ngeografics.com> on 2010/05/25 17:30:10 UTC

session.persist saves object with id 0

Hello,

After checking the tutorial I was trying to do a basic crud app, but 
somehow after submiting the form (beaneditform) the new object is saved 
into the database with id 0.

I'm also new to hibernate so I don't know why in the tapestry tutorial  
is enough with session.persist(object), what happened to the factory, 
session.commit, session.close and the Transaction object? is that all 
included with the @CommitAfter annotation?


Any idea why a new object would be saved with id 0?

regards,

Genis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Res: session.persist saves object with id 0

Posted by Everton Agner <ev...@yahoo.com.br>.
Could you show us how you mapped your Entity? And regardless if it was by XML or Annotations, show your Entity class code too.


De: Peter Stavrinides <P....@albourne.com>
Para: Tapestry users <us...@tapestry.apache.org>; gpujol@ngeografics.com
Enviadas: Terça-feira, 8 de Junho de 2010 5:39:14
Assunto: Re: session.persist saves object with id 0

Perhaps the type is a primitive, so instead of null a default value will be 0? just a guess.

Peter


----- Original Message -----
From: "Genís Pujol" <gp...@ngeografics.com>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Tuesday, 25 May, 2010 18:30:10 GMT +02:00 Athens, Beirut, Bucharest, Istanbul
Subject: session.persist saves object with id 0

Hello,

After checking the tutorial I was trying to do a basic crud app, but 
somehow after submiting the form (beaneditform) the new object is saved 
into the database with id 0.

I'm also new to hibernate so I don't know why in the tapestry tutorial  
is enough with session.persist(object), what happened to the factory, 
session.commit, session.close and the Transaction object? is that all 
included with the @CommitAfter annotation?


Any idea why a new object would be saved with id 0?

regards,

Genis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


      

Re: session.persist saves object with id 0

Posted by Peter Stavrinides <P....@albourne.com>.
Perhaps the type is a primitive, so instead of null a default value will be 0? just a guess.

Peter


----- Original Message -----
From: "Genís Pujol" <gp...@ngeografics.com>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Tuesday, 25 May, 2010 18:30:10 GMT +02:00 Athens, Beirut, Bucharest, Istanbul
Subject: session.persist saves object with id 0

Hello,

After checking the tutorial I was trying to do a basic crud app, but 
somehow after submiting the form (beaneditform) the new object is saved 
into the database with id 0.

I'm also new to hibernate so I don't know why in the tapestry tutorial  
is enough with session.persist(object), what happened to the factory, 
session.commit, session.close and the Transaction object? is that all 
included with the @CommitAfter annotation?


Any idea why a new object would be saved with id 0?

regards,

Genis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org