Suppose I have a table 'student' in DB which is very LARGE. There are several columns in student, including 'id' and 'class-id'.
In hbm file I currently have the defenter code hereinition like this:
<id name="id" column="ID" type="long">
<generator class="native">
<param name="sequence">student_ID_SEQ</param>
<param name="max_lo">999</param>
</generator>
</id>
<property name="class-id" column="class-id" not-null="true" insert="true" update="true"/>
In this case, if I update the student persist class, the query will be like:
update .... set .... where ID={id}
But for partitioning reason, I want to also include the class-id in the query, like:
update .... set .... where ID={id} and class-id={class-id}
I tried composite-id, but noticed generator is not allowed in composite-id, because composite-ids are usually assign-based, not generator-based.
So, I was just wondering, is it possible to add parameters to hibernate generated queries?