nordborg wrote:
Maybe with a custom <sql-update> mapping for your class. See
http://docs.jboss.org/hibernate/stable/ ... erysql-cudI have many objects/mappings with a few very complex objects.
Is it possible to add only "AND name = 'Blabla'" to the original query or do I have to write the whole query for each column in <sql-update> (latter wouldn't be an option)?
Also, do I have to write 'Blabla' hardcoded in the mapping or can I use a certain attribute of the object for this?
SIau_Tie wrote:
are you using session.update(entity)? if yes, why do you need that condition?
I'm using Session.update(entityName, object).
My database must also support partitioning, thus I need this additional attribute in each query (needed for partition determination).
Additional informationI already thought of the following options:
A) Adding a composite-id with both keys to the mapping
B) Altering the hibernate source (but I don't know what exactly I have to change)
Restricting with "AND name = 'Blabla" can also be disabled via a certain property, so I'm trying to avoid changes in the mappings since they are hardcoded there and I have to create/use different mappings if the restriction is enabled or disabled.