LocalQueryComparisonOptions Class
A LocalQueryComparisonOptions instance is used to specify the "comparison rules" used when performing "local queries" in order to match the semantics of these same queries when executed against a remote service. These options should be set based on the manner in which your remote service interprets certain comparison operations.
The default LocalQueryComparisonOptions stipulates 'caseInsensitive" queries with ANSI SQL rules regarding comparisons of unequal length strings.
Item Index
Properties
- caseInsensitiveSQL static
- defaultInstance static
Methods
<ctor> LocalQueryComparisonOptions
-
config
LocalQueryComparisonOptions constructor
Parameters:
-
config
Object-
[name]
String optional -
[isCaseSensitive]
Boolean optionalWhether predicates that involve strings will be interpreted in a "caseSensitive" manner. Default is 'false'
-
[usesSql92CompliantStringComparison]
Boolean optionalWhether of not to enforce the ANSI SQL standard of padding strings of unequal lengths before comparison with spaces. Note that per the standard, padding only occurs with equality and inequality predicates, and not with operations like 'startsWith', 'endsWith' or 'contains'. Default is true.
-
Example:
// create a 'caseSensitive - non SQL' instance.
var lqco = new LocalQueryComparisonOptions({
name: "caseSensitive-nonSQL"
isCaseSensitive: true;
usesSql92CompliantStringComparison: false;
});
// either apply it globally
lqco.setAsDefault();
// or to a specific MetadataStore
var ms = new MetadataStore({ localQueryComparisonOptions: lqco });
var em = new EntityManager( { metadataStore: ms });
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 lqco = new LocalQueryComparisonOptions({
isCaseSensitive: false;
usesSql92CompliantStringComparison: true;
});
lqco.setAsDefault();
Properties
caseInsensitiveSQL
LocalQueryComparisonOptions
static
Case insensitive SQL compliant options - this is also the default unless otherwise changed.
defaultInstance
LocalQueryComparisonOptions
static
The default value whenever LocalQueryComparisonOptions are not specified. By default this is 'caseInsensitiveSQL'.