Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ValidationOptions

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

Hierarchy

  • ValidationOptions

Implements

Index

Constructors

constructor

  • ValidationOptions constructor

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

    Parameters

    Returns ValidationOptions

Properties

validateOnAttach

validateOnAttach: boolean

Whether entity and property level validation should occur when entities are attached to the EntityManager other than via a query. (default = true) Read Only

validateOnPropertyChange

validateOnPropertyChange: boolean

Whether property level validation should occur after entities are modified. (default = true) Read Only

validateOnQuery

validateOnQuery: boolean

Whether entity and property level validation should occur after entities are queried from a remote server. (default = false) Read Only

validateOnSave

validateOnSave: boolean

Whether entity and property level validation should occur before entities are saved. A failed validation will force the save to fail early. (default = true) Read Only

Static defaultInstance

defaultInstance: ValidationOptions = new ValidationOptions({validateOnAttach: true,validateOnSave: true,validateOnQuery: false,validateOnPropertyChange: true})

The default instance for use whenever ValidationOptions are not specified.

Methods

setAsDefault

  • setAsDefault(): any
  • 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.

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

    Returns any

using

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

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

    Parameters

    Returns ValidationOptions

    A new ValidationOptions instance.

Generated using TypeDoc