ch.elca.el4j.services.remoting.jaxb.hibernate
Class HibernateJAXBAccessor<B,V>
java.lang.Object
com.sun.xml.bind.v2.runtime.reflect.Accessor<B,V>
ch.elca.el4j.services.remoting.jaxb.hibernate.HibernateJAXBAccessor<B,V>
- Type Parameters:
B
- the bean typeV
- the value type
- All Implemented Interfaces:
- com.sun.xml.bind.v2.runtime.unmarshaller.Receiver
public class HibernateJAXBAccessor<B,V>
- extends com.sun.xml.bind.v2.runtime.reflect.Accessor<B,V>
A JAXB Accessor that replaces uninitialized values by null
to avoid LazyInitializationException.
- Author:
- clemenb (see https://forum.hibernate.org/viewtopic.php?f=1&t=998896)
- File-location:
- HibernateJAXBAccessor
- Last check-in date:
- 2009-10-16 09:31:52 +0200 (Fr, 16. Okt 2009) by swismer for revision 3945
Nested classes/interfaces inherited from class com.sun.xml.bind.v2.runtime.reflect.Accessor |
com.sun.xml.bind.v2.runtime.reflect.Accessor.FieldReflection<BeanT,ValueT>, com.sun.xml.bind.v2.runtime.reflect.Accessor.GetterOnlyReflection<BeanT,ValueT>, com.sun.xml.bind.v2.runtime.reflect.Accessor.GetterSetterReflection<BeanT,ValueT>, com.sun.xml.bind.v2.runtime.reflect.Accessor.ReadOnlyFieldReflection<BeanT,ValueT>, com.sun.xml.bind.v2.runtime.reflect.Accessor.SetterOnlyReflection<BeanT,ValueT> |
Fields inherited from class com.sun.xml.bind.v2.runtime.reflect.Accessor |
JAXB_ELEMENT_VALUE, valueType |
Constructor Summary |
protected |
HibernateJAXBAccessor(com.sun.xml.bind.v2.runtime.reflect.Accessor<B,V> delegate,
Method hibernateInitializationCheck)
|
Method Summary |
V |
get(B bean)
|
protected V |
hideLazy(V value)
|
com.sun.xml.bind.v2.runtime.reflect.Accessor<B,V> |
optimize(com.sun.xml.bind.v2.runtime.JAXBContextImpl context)
|
void |
set(B bean,
V value)
|
Methods inherited from class com.sun.xml.bind.v2.runtime.reflect.Accessor |
adapt, adapt, getErrorInstance, getUnadapted, getValueType, isAdapted, receive, setUnadapted |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HibernateJAXBAccessor
protected HibernateJAXBAccessor(com.sun.xml.bind.v2.runtime.reflect.Accessor<B,V> delegate,
Method hibernateInitializationCheck)
- Parameters:
delegate
- the delegate accessorhibernateInitializationCheck
- the method to call for checking if value is uninitialized
optimize
public com.sun.xml.bind.v2.runtime.reflect.Accessor<B,V> optimize(com.sun.xml.bind.v2.runtime.JAXBContextImpl context)
- Overrides:
optimize
in class com.sun.xml.bind.v2.runtime.reflect.Accessor<B,V>
get
public V get(B bean)
throws com.sun.xml.bind.api.AccessorException
- Specified by:
get
in class com.sun.xml.bind.v2.runtime.reflect.Accessor<B,V>
- Throws:
com.sun.xml.bind.api.AccessorException
set
public void set(B bean,
V value)
throws com.sun.xml.bind.api.AccessorException
- Specified by:
set
in class com.sun.xml.bind.v2.runtime.reflect.Accessor<B,V>
- Throws:
com.sun.xml.bind.api.AccessorException
hideLazy
protected V hideLazy(V value)
- Parameters:
value
- the value to check
- Returns:
- the value if it is initialized, otherwise
null
Copyright © 2005-2011 ELCA. All Rights Reserved.