Top Description Inners Fields Constructors Methods
org.hibernate.property

public Class BasicPropertyAccessor

extends Object
implements PropertyAccessor
Class Inheritance
All Implemented Interfaces
org.hibernate.property.PropertyAccessor
Imports
java.beans.Introspector, java.lang.reflect.InvocationTargetException, .Method, .Member, java.util.Map, org.slf4j.Logger, .LoggerFactory, org.hibernate.HibernateException, .PropertyAccessException, .PropertyNotFoundException, org.hibernate.engine.SessionFactoryImplementor, .SessionImplementor, org.hibernate.util.ReflectHelper

Accesses property values via a get/set pair, which may be nonpublic. The default (and recommended strategy).
Author
Gavin King

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Getter
createGetter(Class<T> theClass, String propertyName)

private static Setter
createSetter(Class<T> theClass, String propertyName)

public Getter
getGetter(Class<T>
The class on which the property is defined.
theClass
,
String
The name of the property.
propertyName
)

Implements org.hibernate.property.PropertyAccessor.getGetter.

Create a "getter" for the named attribute
private static BasicPropertyAccessor.BasicGetter
getGetterOrNull(Class<T> theClass, String propertyName)

public Setter
getSetter(Class<T>
The class on which the property is defined.
theClass
,
String
The name of the property.
propertyName
)

Implements org.hibernate.property.PropertyAccessor.getSetter.

Create a "setter" for the named attribute
private static BasicPropertyAccessor.BasicSetter
getSetterOrNull(Class<T> theClass, String propertyName)

private static Method
getterMethod(Class<T> theClass, String propertyName)

private static Method
setterMethod(Class<T> theClass, String propertyName)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

logback to summary
private static final Logger log

Constructor Detail

BasicPropertyAccessorback to summary
public BasicPropertyAccessor()

Method Detail

createGetterback to summary
public static Getter createGetter(Class<T> theClass, String propertyName) throws PropertyNotFoundException
createSetterback to summary
private static Setter createSetter(Class<T> theClass, String propertyName) throws PropertyNotFoundException
getGetterback to summary
public Getter getGetter(Class<T> theClass, String propertyName) throws PropertyNotFoundException

Implements org.hibernate.property.PropertyAccessor.getGetter.

Doc from org.hibernate.property.PropertyAccessor.getGetter.

Create a "getter" for the named attribute

Parameters
theClass:Class<T>

The class on which the property is defined.

propertyName:String

The name of the property.

Returns:Getter

An appropriate getter.

Exceptions
PropertyNotFoundException:
Indicates a problem interpretting the propertyName
getGetterOrNullback to summary
private static BasicPropertyAccessor.BasicGetter getGetterOrNull(Class<T> theClass, String propertyName)
getSetterback to summary
public Setter getSetter(Class<T> theClass, String propertyName) throws PropertyNotFoundException

Implements org.hibernate.property.PropertyAccessor.getSetter.

Doc from org.hibernate.property.PropertyAccessor.getSetter.

Create a "setter" for the named attribute

Parameters
theClass:Class<T>

The class on which the property is defined.

propertyName:String

The name of the property.

Returns:Setter

An appropriate setter

Exceptions
PropertyNotFoundException:
Indicates a problem interpretting the propertyName
getSetterOrNullback to summary
private static BasicPropertyAccessor.BasicSetter getSetterOrNull(Class<T> theClass, String propertyName)
getterMethodback to summary
private static Method getterMethod(Class<T> theClass, String propertyName)
setterMethodback to summary
private static Method setterMethod(Class<T> theClass, String propertyName)
org.hibernate.property back to summary

public final Class BasicPropertyAccessor.BasicGetter

extends Object
implements Getter
Class Inheritance
All Implemented Interfaces
org.hibernate.property.Getter, java.io.Serializable

Field Summary

Modifier and TypeField and Description
private Class<T>
private final transient Method
private final String

Constructor Summary

AccessConstructor and Description
private
BasicGetter(Class<T> clazz, Method method, String propertyName)

Method Summary

Modifier and TypeMethod and Description
public Object
get(Object
The instance containing the value to be retreived.
target
)

Implements org.hibernate.property.Getter.get.

Get the property value from the given instance .
public Object
getForInsert(Object
The instance containing the value to be retreived.
target
,
Map<K, V>
a map of merged persistent instances to detached instances
mergeMap
,
SessionImplementor
The session from which this request originated.
session
)

Implements org.hibernate.property.Getter.getForInsert.

Get the property value from the given owner instance.
public Member
getMember()

Implements org.hibernate.property.Getter.getMember.

Retrieve the member to which this property maps.
public Method
getMethod()

Implements org.hibernate.property.Getter.getMethod.

Retrieve the getter-method.
public String
getMethodName()

Implements org.hibernate.property.Getter.getMethodName.

Retrieve the getter-method name.
public Class<T>
getReturnType()

Implements org.hibernate.property.Getter.getReturnType.

Retrieve the declared Java type
pack-priv Object
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

clazzback to summary
private Class<T> clazz
methodback to summary
private final transient Method method
propertyNameback to summary
private final String propertyName

Constructor Detail

BasicGetterback to summary
private BasicGetter(Class<T> clazz, Method method, String propertyName)

Method Detail

getback to summary
public Object get(Object target) throws HibernateException

Implements org.hibernate.property.Getter.get.

Doc from org.hibernate.property.Getter.get.

Get the property value from the given instance .

Parameters
target:Object

The instance containing the value to be retreived.

Returns:Object

The extracted value.

getForInsertback to summary
public Object getForInsert(Object target, Map<K, V> mergeMap, SessionImplementor session)

Implements org.hibernate.property.Getter.getForInsert.

Doc from org.hibernate.property.Getter.getForInsert.

Get the property value from the given owner instance.

Parameters
target:Object

The instance containing the value to be retreived.

mergeMap:Map<K, V>

a map of merged persistent instances to detached instances

session:SessionImplementor

The session from which this request originated.

Returns:Object

The extracted value.

getMemberback to summary
public Member getMember()

Implements org.hibernate.property.Getter.getMember.

Doc from org.hibernate.property.Getter.getMember.

Retrieve the member to which this property maps. This might be the field or it might be the getter method.

Returns:Member

The mapped member.

getMethodback to summary
public Method getMethod()

Implements org.hibernate.property.Getter.getMethod.

Doc from org.hibernate.property.Getter.getMethod.

Retrieve the getter-method.

Optional operation (return null)

Returns:Method

The getter method, or null.

getMethodNameback to summary
public String getMethodName()

Implements org.hibernate.property.Getter.getMethodName.

Doc from org.hibernate.property.Getter.getMethodName.

Retrieve the getter-method name.

Optional operation (return null)

Returns:String

The name of the getter method, or null.

getReturnTypeback to summary
public Class<T> getReturnType()

Implements org.hibernate.property.Getter.getReturnType.

Doc from org.hibernate.property.Getter.getReturnType.

Retrieve the declared Java type

Returns:Class<T>

The declared java type.

readResolveback to summary
pack-priv Object readResolve()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

org.hibernate.property back to summary

public final Class BasicPropertyAccessor.BasicSetter

extends Object
implements Setter
Class Inheritance
All Implemented Interfaces
org.hibernate.property.Setter, java.io.Serializable

Field Summary

Modifier and TypeField and Description
private Class<T>
private final transient Method
private final String

Constructor Summary

AccessConstructor and Description
private
BasicSetter(Class<T> clazz, Method method, String propertyName)

Method Summary

Modifier and TypeMethod and Description
public Method
getMethod()

Implements org.hibernate.property.Setter.getMethod.

Optional operation (return null)
public String
getMethodName()

Implements org.hibernate.property.Setter.getMethodName.

Optional operation (return null)
pack-priv Object
public void
set(Object
The instance upon which to set the given value.
target
,
Object
The value to be set on the target.
value
,
SessionFactoryImplementor
The session factory from which this request originated.
factory
)

Implements org.hibernate.property.Setter.set.

Set the property value from the given instance
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

clazzback to summary
private Class<T> clazz
methodback to summary
private final transient Method method
propertyNameback to summary
private final String propertyName

Constructor Detail

BasicSetterback to summary
private BasicSetter(Class<T> clazz, Method method, String propertyName)

Method Detail

getMethodback to summary
public Method getMethod()

Implements org.hibernate.property.Setter.getMethod.

Doc from org.hibernate.property.Setter.getMethod.

Optional operation (return null)

getMethodNameback to summary
public String getMethodName()

Implements org.hibernate.property.Setter.getMethodName.

Doc from org.hibernate.property.Setter.getMethodName.

Optional operation (return null)

readResolveback to summary
pack-priv Object readResolve()
setback to summary
public void set(Object target, Object value, SessionFactoryImplementor factory) throws HibernateException

Implements org.hibernate.property.Setter.set.

Doc from org.hibernate.property.Setter.set.

Set the property value from the given instance

Parameters
target:Object

The instance upon which to set the given value.

value:Object

The value to be set on the target.

factory:SessionFactoryImplementor

The session factory from which this request originated.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.