Modifier and Type | Field and Description |
---|---|
static io.requery.proxy.EntityStateListener |
EMPTY |
Constructor and Description |
---|
EntityProxy(E entity,
Type<E> type)
Create a new
EntityProxy instance for a given entity object that can proxy it's
getters and setters. |
Modifier and Type | Method and Description |
---|---|
E |
copy() |
boolean |
equals(Object obj) |
<V> V |
get(Attribute<E,V> attribute)
get the current value for an attribute through this proxy.
|
<V> V |
get(Attribute<E,V> attribute,
boolean fetch)
get the current value for an attribute through this proxy.
|
boolean |
getBoolean(Attribute<E,Boolean> attribute) |
byte |
getByte(Attribute<E,Byte> attribute) |
double |
getDouble(Attribute<E,Double> attribute) |
float |
getFloat(Attribute<E,Float> attribute) |
int |
getInt(Attribute<E,Integer> attribute) |
long |
getLong(Attribute<E,Long> attribute) |
short |
getShort(Attribute<E,Short> attribute) |
PropertyState |
getState(Attribute<E,?> attribute)
Gets the current
PropertyState of a given Attribute . |
int |
hashCode() |
boolean |
isLinked() |
Object |
key() |
void |
link(PropertyLoader<E> loader)
link the proxy to a
PropertyLoader instance that will retrieve not loaded property
values. |
EntityStateEventListenable<E> |
modifyListeners() |
void |
postDelete() |
void |
postInsert() |
void |
postLoad() |
void |
postUpdate() |
void |
preDelete() |
void |
preInsert() |
void |
preUpdate() |
<V> void |
set(Attribute<E,V> attribute,
V value)
Set a value through this proxy and change it's corresponding
PropertyState to
PropertyState.MODIFIED . |
<V> void |
set(Attribute<E,V> attribute,
V value,
PropertyState state)
Set a value through this proxy and change it's corresponding
PropertyState . |
void |
setBoolean(Attribute<E,Boolean> attribute,
boolean value,
PropertyState state) |
void |
setByte(Attribute<E,Byte> attribute,
byte value,
PropertyState state) |
void |
setDouble(Attribute<E,Double> attribute,
double value,
PropertyState state) |
void |
setFloat(Attribute<E,Float> attribute,
float value,
PropertyState state) |
void |
setInt(Attribute<E,Integer> attribute,
int value,
PropertyState state) |
void |
setLong(Attribute<E,Long> attribute,
long value,
PropertyState state) |
void |
setObject(Attribute<E,?> attribute,
Object value,
PropertyState state)
Unchecked version of set, use only when the the attribute type is not known.
|
void |
setShort(Attribute<E,Short> attribute,
short value,
PropertyState state) |
void |
setState(Attribute<E,?> attribute,
PropertyState state)
Sets the current
PropertyState of a given Attribute . |
Object |
syncObject() |
String |
toString() |
Type<E> |
type() |
void |
unlink() |
public EntityProxy(E entity, Type<E> type)
EntityProxy
instance for a given entity object that can proxy it's
getters and setters.entity
- the entity that is being proxiedtype
- the entity meta type instancepublic <V> V get(Attribute<E,V> attribute)
Gettable
get
in interface Gettable<E>
V
- type of the attributeattribute
- to getPropertyLoader
instance to
retrieve it if required.public <V> V get(Attribute<E,V> attribute, boolean fetch)
Gettable
get
in interface Gettable<E>
V
- type fo the attributeattribute
- to getfetch
- true to fetch the value through the PropertyLoader
if setPropertyLoader
instance to
retrieve it if fetch = true.public boolean getBoolean(Attribute<E,Boolean> attribute)
getBoolean
in interface Gettable<E>
public <V> void set(Attribute<E,V> attribute, V value)
Settable
PropertyState
to
PropertyState.MODIFIED
.public <V> void set(Attribute<E,V> attribute, V value, PropertyState state)
Settable
PropertyState
.public void setObject(Attribute<E,?> attribute, Object value, PropertyState state)
Settable
public void setInt(Attribute<E,Integer> attribute, int value, PropertyState state)
public void setLong(Attribute<E,Long> attribute, long value, PropertyState state)
public void setShort(Attribute<E,Short> attribute, short value, PropertyState state)
public void setByte(Attribute<E,Byte> attribute, byte value, PropertyState state)
public void setFloat(Attribute<E,Float> attribute, float value, PropertyState state)
public void setDouble(Attribute<E,Double> attribute, double value, PropertyState state)
public void setBoolean(Attribute<E,Boolean> attribute, boolean value, PropertyState state)
setBoolean
in interface Settable<E>
public void setState(Attribute<E,?> attribute, PropertyState state)
PropertyState
of a given Attribute
.attribute
- to setstate
- state to setpublic PropertyState getState(Attribute<E,?> attribute)
PropertyState
of a given Attribute
.attribute
- to getpublic Object key()
public boolean isLinked()
PropertyLoader
instance that will retrieve not loaded
property values.public void link(PropertyLoader<E> loader)
PropertyLoader
instance that will retrieve not loaded property
values.loader
- instancepublic void unlink()
public E copy()
public Object syncObject()
public EntityStateEventListenable<E> modifyListeners()
public void preUpdate()
public void postUpdate()
public void preInsert()
public void postInsert()
public void preDelete()
public void postDelete()
public void postLoad()