public class PropertyQuery<V> extends Object
Queries a target class for properties that match certain criteria. A property may either be a private or public field, declared by the target class or inherited from a superclass, or a public method declared by the target class or inherited from any of its superclasses. For properties that are exposed via a method, the property must be a JavaBean style property, i.e. it must provide both an accessor and mutator method according to the JavaBean specification.
This class is not thread-safe, however the result returned by the getResultList() method is.
PropertyQueries
,
PropertyCriteria
Modifier and Type | Method and Description |
---|---|
PropertyQuery<V> |
addCriteria(PropertyCriteria criteria)
Add a criteria to query
|
Property<V> |
getFirstResult()
Get the first result from the query, causing the query to be run.
|
Property<V> |
getFirstWritableResult()
Get the first result from the query that is not marked as read only, causing the query to be run.
|
List<Property<V>> |
getResultList()
Get the result from the query, causing the query to be run.
|
Property<V> |
getSingleResult()
Get a single result from the query, causing the query to be run.
|
List<Property<V>> |
getWritableResultList()
Get the non read only results from the query, causing the query to be run.
|
Property<V> |
getWritableSingleResult()
Get a single result from the query that is not marked as read only, causing the query to be run.
|
public PropertyQuery<V> addCriteria(PropertyCriteria criteria)
criteria
- the criteria to addpublic Property<V> getFirstResult()
public Property<V> getFirstWritableResult()
public Property<V> getSingleResult()
RuntimeException
- if the query does not return exactly one resultpublic Property<V> getWritableSingleResult()
RuntimeException
- if the query does not return exactly one resultpublic List<Property<V>> getResultList()
Copyright © 2017 JBoss by Red Hat. All rights reserved.