NoopAccessor for HQL-only properties
Description
Attachments
1
Activity
Show:

GavinG August 11, 2005 at 8:23 AM
Thanks, committed.

Michael Bartmann May 28, 2005 at 12:54 PM
Here comes a trivial implementation, which should
do the job. Of course this does not solve mapping
via an access="noop" short name.
Fixed
Details
Details
Assignee
Unassigned
UnassignedReporter

Original estimate
Time tracking
No time logged2h remaining
Components
Fix versions
Priority
Created May 28, 2005 at 12:34 PM
Updated June 28, 2019 at 5:21 PM
Resolved August 11, 2005 at 8:23 AM
Hibernate should contain a NoopAccessor.
A property with access="noop", insert="false", update="false"
does not need any member in the pojo, but it can be mapped to
a database column.
This is very usefull for HQL queries which refer to information
not available at the pojo level.
Example: the index column of an indexed many-to-one relation is
represented by a multi-valued list on the parent side.
Representing the index on the child side is akward, because
updating this information at the pojo level is very expensive.
But if the index column is not mapped on the child side, HQL
queries can only use the builtin index()-function, which has the
limitation that it can only be used when joining from parent
side to children side.
Using a "noop" mapping avoids the problem of updating each child
when inserting and modifying index order, but allows you to do
any query based on the index at minimum cost (no double-joins).