2.17.2: 2011-06-17

net.sf.basedb.core
Class ExtendedPropertyAccessor

java.lang.Object
  extended by net.sf.basedb.core.ExtendedPropertyAccessor
All Implemented Interfaces:
org.hibernate.property.PropertyAccessor

public final class ExtendedPropertyAccessor
extends Object
implements org.hibernate.property.PropertyAccessor

This class is used to interface with Hibernate for extended properties. We need specialized getter and setter methods since there are no regulare get and set methods for the extended properties. Ie. we have to call getExtended("name") instead of getName().

During startup Hibernate creates a pair of Getter and Setter objects for each extended property of an Extendable item. These objects are then used to access the extended properties for all items via the GetterSetter.get and GetterSetter.set methods.

Version:
2.0
Author:
Nicklas, Samuel
See Also:
ExtendableData, ExtendedProperty, ExtendedProperties

Nested Class Summary
(package private) static class ExtendedPropertyAccessor.GetterSetter
          This class implements the Hibernate Getter and Setter interfaces.
 
Constructor Summary
ExtendedPropertyAccessor()
          Create a new ExtendedPropertyAccessor object.
 
Method Summary
 org.hibernate.property.Getter getGetter(Class clazz, String property)
          Create a Getter object for the specified class and property.
 org.hibernate.property.Setter getSetter(Class clazz, String property)
          Create a Setter object for the specified class and property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedPropertyAccessor

public ExtendedPropertyAccessor()
Create a new ExtendedPropertyAccessor object.

Method Detail

getGetter

public org.hibernate.property.Getter getGetter(Class clazz,
                                               String property)
                                        throws org.hibernate.PropertyNotFoundException
Create a Getter object for the specified class and property.

Specified by:
getGetter in interface org.hibernate.property.PropertyAccessor
Parameters:
clazz - The Class of the item
property - The name of the property
Throws:
org.hibernate.PropertyNotFoundException - If the item is not Extendable

getSetter

public org.hibernate.property.Setter getSetter(Class clazz,
                                               String property)
                                        throws org.hibernate.PropertyNotFoundException
Create a Setter object for the specified class and property.

Specified by:
getSetter in interface org.hibernate.property.PropertyAccessor
Parameters:
clazz - The Class of the item
property - The name of the property
Throws:
org.hibernate.PropertyNotFoundException - If the item is not Extendable

2.17.2: 2011-06-17