T
- the type of EntityK
- the primary key typepublic 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.
Constructor and Description |
---|
ReadOnlyEntityProxy(EntityManager manager,
EntityInfo<T,K> entityInfo,
K key) |
Modifier and Type | Method and Description |
---|---|
void |
addValue(String fieldName,
ResultSet res) |
boolean |
equals(Object obj) |
boolean |
equalsImpl(RawEntity<K> proxy,
Object obj) |
K |
getKey() |
int |
hashCode() |
int |
hashCodeImpl() |
Object |
invoke(Object proxy,
Method method,
Object[] args) |
String |
toStringImpl() |
public ReadOnlyEntityProxy(EntityManager manager, EntityInfo<T,K> entityInfo, K key)
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
Throwable
public void addValue(String fieldName, ResultSet res) throws SQLException
SQLException
public K getKey()
public int hashCodeImpl()
public String toStringImpl()
Copyright © 2007–2022 Atlassian. All rights reserved.