saveOrUpdate « Column « JPA Q&A





1. saveOrUpdate returns a wrong identity column    forum.hibernate.org

2. saveOrUpdate - use column other than ID    forum.hibernate.org

Hi all, I've been struggling here for a bit. I'm trying to use the saveOrUpdate to save/update an object where I don't want to use the primary key (id which is generated) but rather a different column (name for example). Avoiding a lot of background discussion, the situation I'm in I have no control over. I'm given a file of serialized ...

3. saveOrUpdate: excluding column without saying update=false    forum.hibernate.org

Nope, nothing like that. Hibernate persists objects, not bits of objects, so it's highly unlikely to ever be implemented like that. I know I'd argue against it. If you have fields that you don't always want saved, you could use a one-to-one cascade="none" to the same table, and have a main object and a rarely-saved object, then figure out in business ...

4. Managing automatically an Index column in saveOrUpdate ()    forum.hibernate.org

Actually, I had read the manual (a couple of times ;-) ! We did add the column to the mapping ! I does work with SELECT (List()) when the index column is propely set with data. Dealing with saving (INSERT) objects, the index column is not incremented by hibernate (the column remains with a null value) ; then, the SELECT does ...

5. saveOrUpdate annotation where a Column is "unique"    forum.hibernate.org

Hi, I'm hoping someone can help. I've got a column in my table (in SQL Server 2005) which isn't a primary key, but does need to be unique (I've set a unique constraint on this column). Using SQL I can manually update like so: UPDATE MyTable SET AColumn='foobar' where uniqueField='1234-UNIQ'; This works fine; so I know from the point-of-view of the ...