Show:

QueryOptions Class

A QueryOptions instance is used to specify the 'options' under which a query will occur.

Methods

<ctor> QueryOptions

(
  • [config]
)

QueryOptions constructor

Parameters:

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

(
  • config
)
QueryOptions chainable

Returns a copy of this QueryOptions with the specified MergeStrategy or FetchStrategy applied.

Parameters:

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 });

Properties

defaultInstance

QueryOptions static

The default value whenever QueryOptions are not specified.