Package net.java.ao
Class ReadOnlyEntityProxy<T extends RawEntity<K>,K>
java.lang.Object
net.java.ao.ReadOnlyEntityProxy<T,K>
- Type Parameters:
T
- the type of EntityK
- the primary key type
- All Implemented Interfaces:
InvocationHandler
public class ReadOnlyEntityProxy<T extends RawEntity<K>,K>
extends Object
implements InvocationHandler
A read-only representation of a database row proxy, mapped to the specified Entity type.
This implementation is used for streaming and intended to be as lightweight as possible. It only supports getters
or designated Accessor
methods. Calling setters or save will result in an exception. Other method calls will
be ignored.
As much as possible, reflection calls should be kept out of this implementation. If there is information needed about
the implemented type, please use EntityInfo
to cache them.
TODO There is currently some overlap with EntityProxy
. As soon as this is battle-hardened, these can be refactored
into an abstract superclass, for example.
- Author:
- ahennecke
-
Constructor Summary
ConstructorsConstructorDescriptionReadOnlyEntityProxy
(EntityManager manager, EntityInfo<T, K> entityInfo, K key) -
Method Summary
-
Constructor Details
-
ReadOnlyEntityProxy
-
-
Method Details
-
invoke
- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-
addValue
- Throws:
SQLException
-
getKey
-
hashCodeImpl
public int hashCodeImpl() -
equalsImpl
-
toStringImpl
-
equals
-
hashCode
public int hashCode()
-