Show:

ValidationOptions Class

Module: breeze

A ValidationOptions instance is used to specify the conditions under which validation will be executed.

Methods

<ctor> ValidationOptions

(
  • [config]
)

ValidationOptions constructor

Parameters:

  • [config] Object optional
    • [validateOnAttach=true] Boolean optional
    • [validateOnSave=true] Boolean optional
    • [validateOnQuery=false] Boolean optional
    • [validateOnPropertyChange=true] Boolean optional

Example:

var newVo = new ValidationOptions( { validateOnSave: false, validateOnAttach: false });
// assume em1 is a preexisting EntityManager
em1.setProperties( { validationOptions: newVo });

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 validationOptions = new ValidationOptions()
var newOptions = validationOptions.using( { validateOnQuery: true, validateOnSave: false} );
var newOptions.setAsDefault();

using

(
  • config
)
ValidationOptions chainable

Returns a copy of this ValidationOptions with changes to the specified config properties.

Parameters:

  • config Object

    The object to apply to create a new QueryOptions.

    • [validateOnAttach] Boolean optional
    • [validateOnSave] Boolean optional
    • [validateOnQuery] Boolean optional
    • [validateOnPropertyChange] Boolean optional

Returns:

Example:

var validationOptions = new ValidationOptions();
var newOptions = validationOptions.using( { validateOnQuery: true, validateOnSave: false} );

Properties

defaultInstance

ValidationOptions static

The default value whenever ValidationOptions are not specified.

validateOnAttach

Boolean

Whether entity and property level validation should occur when entities are attached to the EntityManager other than via a query.

readOnly

validateOnPropertyChange

Boolean

Whether property level validation should occur after entities are modified.

readOnly

validateOnQuery

Boolean

Whether entity and property level validation should occur after entities are queried from a remote server.

readOnly

validateOnSave

Boolean

Whether entity and property level validation should occur before entities are saved. A failed validation will force the save to fail early.

readOnly