public class JavaReflectionAttributeAccessor extends Object implements JpaAttributeAccessor
JpaAttributeAccessor
that works on the server by
reflectively reading fields and/or invoking getter methods.Constructor and Description |
---|
JavaReflectionAttributeAccessor() |
Modifier and Type | Method and Description |
---|---|
<X,Y> Y |
get(javax.persistence.metamodel.Attribute<X,Y> attr,
X entity)
Retrieves the current value of the given attribute from the given entity.
|
<X,Y> void |
set(javax.persistence.metamodel.Attribute<X,Y> attr,
X entity,
Y value)
Sets the current value of the given attribute on the given entity.
|
public <X,Y> Y get(javax.persistence.metamodel.Attribute<X,Y> attr, X entity)
JpaAttributeAccessor
get
in interface JpaAttributeAccessor
attr
- The attribute to retrieve. Must not be null.entity
- the entity instance to read the attribute value from. Must not be null.public <X,Y> void set(javax.persistence.metamodel.Attribute<X,Y> attr, X entity, Y value)
JpaAttributeAccessor
set
in interface JpaAttributeAccessor
attr
- The attribute to retrieve. Must not be null.entity
- the entity instance to read the attribute value from. Must not be
null.value
- The new value for the attribute. May be null.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.