QueryOptions Class
A QueryOptions instance is used to specify the 'options' under which a query will occur.
Item Index
Methods
Properties
Methods
<ctor> QueryOptions
(
-
[config]
QueryOptions constructor
Parameters:
-
[config]
Object optional-
[fetchStrategy]
FetchStrategy optional -
[mergeStrategy]
MergeStrategy optional
-
Example:
var newQo = new QueryOptions( { mergeStrategy: MergeStrategy.OverwriteChanges });
// assume em1 is a preexisting EntityManager
em1.setProperties( { queryOptions: newQo });
Any QueryOptions property that is not defined will be defaulted from any QueryOptions defined at a higher level in the breeze hierarchy, i.e.
- from query.queryOptions
- to entityManager.queryOptions
- to QueryOptions.defaultInstance;
setAsDefault
()
chainable
Sets the 'defaultInstance' by creating a copy of the current 'defaultInstance' and then applying all of the properties of the current instance. The current instance is returned unchanged.
Example:
var newQo = new QueryOptions( { mergeStrategy: MergeStrategy.OverwriteChanges });
newQo.setAsDefault();
using
(
QueryOptions
chainable
-
config
Returns a copy of this QueryOptions with the specified MergeStrategy or FetchStrategy applied.
Parameters:
-
config
Configuration Object | MergeStrategy | FetchStrategyThe object to apply to create a new QueryOptions.
Returns:
Example:
var queryOptions = em1.queryOptions.using(MergeStrategy.PreserveChanges);
or
var queryOptions = em1.queryOptions.using(FetchStrategy.FromLocalCache);
or
var queryOptions = em1.queryOptions.using( { mergeStrategy: OverwriteChanges });