Is it possible to map a database column using Hiberanate, so I can use it in HQL queries, but not map it to an actual property in the mapped class?
I don't need this attribute in my class and would like to avoid the clutter of getter and setter, which never should get used anyways.
The usecase I have is to set a flag on certain rows, so a different process will pick up the row and process it. We just have to do an update on the field like this:
update FJ345KJ set wrkxGrumble=1
where wrkxGrumble = 0
and -- more constraints comming here
Since the table and column names forced upon us by the database resemble hashcodes we want to use HQL for the update, which can use nice mapped names. Therefore we need the column mapped in Hibernate.
@Column(name='wrkxGrumble') Boolean isNameChangeRequested() {...}So I am still trying to understand the use case.