Errai 3.0.1-SNAPSHOT

org.jboss.errai.jpa.sync.client.shared
Interface JpaAttributeAccessor

All Known Implementing Classes:
ErraiAttributeAccessor, JavaReflectionAttributeAccessor

public interface JpaAttributeAccessor

JPA attribute values cannot be obtained the same way on the client as on the server. This interface is the neutral ground that can be used in shared code.

Author:
Jonathan Fuerth

Method Summary
<X,Y> Y
get(javax.persistence.metamodel.Attribute<X,Y> attribute, X entity)
          Retrieves the current value of the given attribute from the given entity.
<X,Y> void
set(javax.persistence.metamodel.Attribute<X,Y> attribute, X entity, Y value)
          Sets the current value of the given attribute on the given entity.
 

Method Detail

get

<X,Y> Y get(javax.persistence.metamodel.Attribute<X,Y> attribute,
            X entity)
Retrieves the current value of the given attribute from the given entity.

Parameters:
attribute - The attribute to retrieve. Must not be null.
entity - the entity instance to read the attribute value from. Must not be null.
Returns:
The value of the given attribute. May be null.
Throws:
NullPointerException - if either argument is null.

set

<X,Y> void set(javax.persistence.metamodel.Attribute<X,Y> attribute,
               X entity,
               Y value)
Sets the current value of the given attribute on the given entity.

Parameters:
entity - the entity instance to read the attribute value from. Must not be null.
attribute - The attribute to retrieve. Must not be null.
value - The new value for the attribute. May be null.
Throws:
NullPointerException - if attribute or entity is null.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.