public class FluentLoader<E extends Entity<K>,K>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FluentLoader.ById<E extends Entity<K>,K> |
static class |
FluentLoader.ByQuery<E extends Entity<K>,K> |
Constructor and Description |
---|
FluentLoader(java.lang.Class<E> entityClass,
DataManager dataManager) |
FluentLoader(java.lang.Class<E> entityClass,
DataManager dataManager,
boolean transactional) |
Modifier and Type | Method and Description |
---|---|
FluentLoader<E,K> |
dynamicAttributes(boolean dynamicAttributes)
Sets loading of dynamic attributes.
|
FluentLoader.ById<E,K> |
id(K id)
Sets the entity identifier.
|
java.util.List<E> |
list()
Loads a list of entities.
|
E |
one()
Loads a single instance.
|
java.util.Optional<E> |
optional()
Loads a single instance and wraps it in Optional.
|
FluentLoader.ByQuery<E,K> |
query(java.lang.String queryString)
Sets the query text.
|
FluentLoader<E,K> |
softDeletion(boolean softDeletion)
Sets soft deletion.
|
FluentLoader<E,K> |
view(java.lang.String viewName)
Sets a view by name.
|
FluentLoader<E,K> |
view(View view)
Sets a view.
|
public FluentLoader(java.lang.Class<E> entityClass, DataManager dataManager)
public FluentLoader(java.lang.Class<E> entityClass, DataManager dataManager, boolean transactional)
public java.util.List<E> list()
public java.util.Optional<E> optional()
public E one()
java.lang.IllegalStateException
- if nothing was loadedpublic FluentLoader<E,K> view(View view)
public FluentLoader<E,K> view(java.lang.String viewName)
public FluentLoader<E,K> softDeletion(boolean softDeletion)
public FluentLoader<E,K> dynamicAttributes(boolean dynamicAttributes)
public FluentLoader.ById<E,K> id(K id)
public FluentLoader.ByQuery<E,K> query(java.lang.String queryString)