nordborg wrote:
I suggest that you use session.merge(). It should give you the desired behavior. See
http://docs.jboss.org/hibernate/stable/ ... veorupdateI tried "session.merge()", and it didn't work for me, as it generated many "select" sql statements, which I don't want.
I want to end-up with efficient SQL queries: the code should do an SQL update first, and only if that update returned 0 rows, it should do an SQL insert (I could write this code easily in JDBC). No "select" queries are needed.
Any other suggestion?
-Ivan