Top Description Inners Constructors Methods
org.hibernate.property

public Class DirectPropertyAccessor

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

Accesses fields directly.
Author
Gavin King

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Field
getField(Class<T> clazz, String name)

private static Field
getField(Class<T> root, Class<T> clazz, String name)

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
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
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DirectPropertyAccessorback to summary
public DirectPropertyAccessor()

Method Detail

getFieldback to summary
private static Field getField(Class<T> clazz, String name) throws PropertyNotFoundException
getFieldback to summary
private static Field getField(Class<T> root, Class<T> clazz, String name) 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
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
org.hibernate.property back to summary

public final Class DirectPropertyAccessor.DirectGetter

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv
DirectGetter(Field field, Class<T> clazz, String name)

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 final Class<T> clazz
fieldback to summary
private final transient Field field
nameback to summary
private final String name

Constructor Detail

DirectGetterback to summary
pack-priv DirectGetter(Field field, Class<T> clazz, String name)

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 DirectPropertyAccessor.DirectSetter

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv
DirectSetter(Field field, Class<T> clazz, String name)

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 final Class<T> clazz
fieldback to summary
private final transient Field field
nameback to summary
private final String name

Constructor Detail

DirectSetterback to summary
pack-priv DirectSetter(Field field, Class<T> clazz, String name)

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.