You can't use save or update or any of the other Session-provided save methods with a custom where clause. But my answer to your "On a related object" question will help...
The new HQL parser has support for an "update" keyword, so you can write a special query to update a few columns. If you want certain columns to be read-only
always, you can add update="false" in their mapping.
Code:
update <ClassName> set <Prop1> = :Value1,
<Prop2> = :Value2
where <custom clause>
If HQL doesn't support whatever your optimistic locking keywords are, you can use raw SQL to do it, via an SQL query. You probably don't want to use the sql-upadte element in your mapping file, as that's
always used to save, whereas a custom update query can be used when you need optimistic locking, and ignore when you don't need it.