public final class NopPropertyAccessor
extends java.lang.Object
implements org.hibernate.property.PropertyAccessor
PropertyAccessor
. This is
necessary to implement computed column support. Specifically, computed
columns are used in P2J to support embedding the rtrim()
and
upper()
functions in database indexes for text-based index
components.
If a database dialect requires computed columns, these are injected
programatically into the Hibernate ORM documents during server startup.
The are set to be read-only, that is, each has its insert
and
update
attribute set to false. Furthermore, to prevent the
need to represent these columns in the DMO classes themselves, this class
is used as Hibernate's property accessor, to intercept Hibernate's requests
to get and set DMO properties. This is necessary because the computed
column data is only needed by queries at the database level, never in
application logic.
An instance of this class, when requested to retrieve the accessor's
Getter
, returns an object which always returns
null
, and which reports the type of the property which is the
basis for the computed column.
When the accessor's Setter
is requested, an object is returned
which simply does nothing when asked to set a property value into a DMO.
Modifier and Type | Class and Description |
---|---|
private static class |
NopPropertyAccessor.NopGetter
Implementation of a do-nothing
Getter . |
private static class |
NopPropertyAccessor.NopSetter
Implementation of a do-nothing
Setter . |
Modifier and Type | Field and Description |
---|---|
private static org.hibernate.property.Setter |
setter
Do-nothing
Setter instance |
Constructor and Description |
---|
NopPropertyAccessor() |
Modifier and Type | Method and Description |
---|---|
org.hibernate.property.Getter |
getGetter(java.lang.Class theClass,
java.lang.String propertyName)
Return a do-nothing
Getter . |
org.hibernate.property.Setter |
getSetter(java.lang.Class theClass,
java.lang.String propertyName)
Return a do-nothing
Setter . |
private static final org.hibernate.property.Setter setter
Setter
instancepublic org.hibernate.property.Getter getGetter(java.lang.Class theClass, java.lang.String propertyName) throws org.hibernate.PropertyNotFoundException
Getter
.getGetter
in interface org.hibernate.property.PropertyAccessor
theClass
- DMO type.propertyName
- DMO property name.Getter
.org.hibernate.PropertyNotFoundException
PropertyAccessor.getGetter(java.lang.Class, java.lang.String)
public org.hibernate.property.Setter getSetter(java.lang.Class theClass, java.lang.String propertyName) throws org.hibernate.PropertyNotFoundException
Setter
.getSetter
in interface org.hibernate.property.PropertyAccessor
theClass
- DMO type.propertyName
- DMO property name.Setter
.org.hibernate.PropertyNotFoundException
PropertyAccessor.getSetter(java.lang.Class, java.lang.String)