public class LspsDatabaseAccess extends Object
Modifier and Type | Field and Description |
---|---|
protected ExecutionContext |
executionContext |
protected ModelProviderClientService |
modelProviderService |
protected SharedRecordTypeFactory |
recordFactory |
protected com.whitestein.lsps.model.sharedrecord.SharedRecordType |
srt
type converted to the shared record type. |
RecordType |
type
The type of the record to retrieve.
|
Modifier | Constructor and Description |
---|---|
protected |
LspsDatabaseAccess(RecordType type,
ExecutionContext executionContext,
ModelProviderClientService modelProviderService,
SharedRecordTypeFactory recordFactory) |
Modifier and Type | Method and Description |
---|---|
protected List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> |
computeOrderings(SortSpec sort) |
protected Expression |
computeWhereExpression(com.google.common.collect.ImmutableSet<Filter> filters) |
int |
count(com.google.common.collect.ImmutableSet<Filter> filters) |
static LspsDatabaseAccess |
forQuery(Variant.ClosureVariant queryClosure,
ExecutionContext executionContext,
ModelProviderClientService modelProviderService,
SharedRecordTypeFactory recordFactory)
Provides shared record instances returned by a query function called by given closure.
|
static LspsDatabaseAccess |
forType(RecordType type,
ExecutionContext executionContext,
ModelProviderClientService modelProviderService,
SharedRecordTypeFactory recordFactory)
Provides shared record instances of given type.
|
protected String |
getIteratorExpression(Filter.ValueProvider<?> valueProvider)
Returns an expression in the form of "i.field1.field2..." for given value provider.
|
protected String |
getIteratorExpression(ISort sort)
Returns an expression in the form of "i.field1.field2..." for given value provider.
|
ListHolder |
list(com.google.common.collect.ImmutableSet<Filter> filters,
SortSpec sort,
int startIndex,
int count) |
public final RecordType type
protected final com.whitestein.lsps.model.sharedrecord.SharedRecordType srt
type
converted to the shared record type.protected final ExecutionContext executionContext
protected final ModelProviderClientService modelProviderService
protected final SharedRecordTypeFactory recordFactory
protected LspsDatabaseAccess(RecordType type, ExecutionContext executionContext, ModelProviderClientService modelProviderService, SharedRecordTypeFactory recordFactory)
public static LspsDatabaseAccess forType(RecordType type, ExecutionContext executionContext, ModelProviderClientService modelProviderService, SharedRecordTypeFactory recordFactory)
type
- the shared record type, not null.executionContext
- not nullmodelProviderService
- not nullrecordFactory
- not nullpublic static LspsDatabaseAccess forQuery(Variant.ClosureVariant queryClosure, ExecutionContext executionContext, ModelProviderClientService modelProviderService, SharedRecordTypeFactory recordFactory)
queryClosure
- the closure, not null. The closure must be parameterless and must call a query function:
{ -> [[..;]..;]query(["param1", "param2"]); }
executionContext
- not nullmodelProviderService
- not nullrecordFactory
- not nullprotected String getIteratorExpression(Filter.ValueProvider<?> valueProvider)
valueProvider
- the value provider, not null.protected String getIteratorExpression(ISort sort)
sort
- the sort, not null.protected final Expression computeWhereExpression(com.google.common.collect.ImmutableSet<Filter> filters) throws ValidationException
ValidationException
protected final List<com.whitestein.lsps.model.sharedrecord.QueryOrderingItem> computeOrderings(SortSpec sort)
public ListHolder list(com.google.common.collect.ImmutableSet<Filter> filters, SortSpec sort, int startIndex, int count)
public int count(com.google.common.collect.ImmutableSet<Filter> filters)
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.