breeze-client 2.2.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +83 -63
- package/adapters/abstract-data-service-adapter.d.ts +120 -0
- package/adapters/abstract-data-service-adapter.js +395 -0
- package/adapters/abstract-data-service-adapter.js.map +1 -0
- package/adapters/adapter-ajax-fetch.d.ts +12 -0
- package/adapters/adapter-ajax-fetch.js +13 -0
- package/adapters/adapter-ajax-fetch.js.map +1 -0
- package/{adapter-ajax-post → adapters}/adapter-ajax-post.d.ts +40 -36
- package/{fesm2022/breeze-client-adapter-ajax-post.mjs → adapters/adapter-ajax-post.js} +80 -82
- package/adapters/adapter-ajax-post.js.map +1 -0
- package/{adapter-ajax-fetch → adapters}/adapter-core.d.ts +4 -4
- package/{fesm2022/breeze-client-adapter-uri-builder-json.mjs → adapters/adapter-core.js} +48 -91
- package/adapters/adapter-core.js.map +1 -0
- package/adapters/adapter-data-service-webapi.d.ts +9 -0
- package/{fesm2022/breeze-client-adapter-data-service-webapi.mjs → adapters/adapter-data-service-webapi.js} +105 -107
- package/adapters/adapter-data-service-webapi.js.map +1 -0
- package/adapters/adapter-model-library-backing-store.d.ts +32 -0
- package/adapters/adapter-model-library-backing-store.js +321 -0
- package/adapters/adapter-model-library-backing-store.js.map +1 -0
- package/adapters/adapter-uri-builder-json.d.ts +11 -0
- package/adapters/adapter-uri-builder-json.js +40 -0
- package/adapters/adapter-uri-builder-json.js.map +1 -0
- package/adapters/http.d.ts +52 -0
- package/adapters/http.js +202 -0
- package/adapters/http.js.map +1 -0
- package/angular/adapter-angular-httpclient.d.ts +21 -0
- package/angular/adapter-angular-httpclient.js +70 -0
- package/angular/adapter-angular-httpclient.js.map +1 -0
- package/breeze.d.ts +215 -0
- package/breeze.js +141 -0
- package/breeze.js.map +1 -0
- package/config/config.d.ts +212 -0
- package/config/config.js +392 -0
- package/config/config.js.map +1 -0
- package/config/configure.d.ts +66 -0
- package/config/configure.js +46 -0
- package/config/configure.js.map +1 -0
- package/config/default-adapters.d.ts +1 -0
- package/config/default-adapters.js +40 -0
- package/config/default-adapters.js.map +1 -0
- package/config/interface-registry.d.ts +191 -0
- package/config/interface-registry.js +5 -0
- package/config/interface-registry.js.map +1 -0
- package/{src → core}/assert-param.d.ts +52 -60
- package/core/assert-param.js +390 -0
- package/core/assert-param.js.map +1 -0
- package/core/core.d.ts +285 -0
- package/core/core.js +772 -0
- package/core/core.js.map +1 -0
- package/core/enum.d.ts +116 -0
- package/core/enum.js +167 -0
- package/core/enum.js.map +1 -0
- package/core/event.d.ts +169 -0
- package/core/event.js +338 -0
- package/core/event.js.map +1 -0
- package/entity/array.d.ts +3 -0
- package/entity/array.js +4 -0
- package/entity/array.js.map +1 -0
- package/entity/complex-array.d.ts +17 -0
- package/entity/complex-array.js +104 -0
- package/entity/complex-array.js.map +1 -0
- package/entity/default-property-interceptor.d.ts +1 -0
- package/entity/default-property-interceptor.js +496 -0
- package/entity/default-property-interceptor.js.map +1 -0
- package/{src → entity}/entity-action.d.ts +36 -42
- package/entity/entity-action.js +45 -0
- package/entity/entity-action.js.map +1 -0
- package/entity/entity-aspect.d.ts +457 -0
- package/entity/entity-aspect.js +1262 -0
- package/entity/entity-aspect.js.map +1 -0
- package/entity/entity-base.d.ts +55 -0
- package/entity/entity-base.js +41 -0
- package/entity/entity-base.js.map +1 -0
- package/entity/entity-group.d.ts +1 -0
- package/entity/entity-group.js +224 -0
- package/entity/entity-group.js.map +1 -0
- package/entity/entity-key.d.ts +95 -0
- package/entity/entity-key.js +189 -0
- package/entity/entity-key.js.map +1 -0
- package/{src → entity}/entity-state.d.ts +112 -84
- package/entity/entity-state.js +135 -0
- package/entity/entity-state.js.map +1 -0
- package/entity/key-generator.d.ts +57 -0
- package/entity/key-generator.js +155 -0
- package/entity/key-generator.js.map +1 -0
- package/entity/observable-array.d.ts +25 -0
- package/entity/observable-array.js +230 -0
- package/entity/observable-array.js.map +1 -0
- package/entity/primitive-array.d.ts +12 -0
- package/entity/primitive-array.js +71 -0
- package/entity/primitive-array.js.map +1 -0
- package/entity/relation-array.d.ts +24 -0
- package/entity/relation-array.js +176 -0
- package/entity/relation-array.js.map +1 -0
- package/entity/unattached-children-map.d.ts +1 -0
- package/entity/unattached-children-map.js +105 -0
- package/entity/unattached-children-map.js.map +1 -0
- package/generate-entity-classes.js +1176 -0
- package/manager/entity-manager.d.ts +801 -0
- package/manager/entity-manager.js +2395 -0
- package/manager/entity-manager.js.map +1 -0
- package/{src → manager}/save-options.d.ts +48 -42
- package/manager/save-options.js +51 -0
- package/manager/save-options.js.map +1 -0
- package/{src → metadata}/data-service.d.ts +229 -184
- package/metadata/data-service.js +246 -0
- package/metadata/data-service.js.map +1 -0
- package/metadata/data-type.d.ts +122 -0
- package/metadata/data-type.js +465 -0
- package/metadata/data-type.js.map +1 -0
- package/metadata/entity-metadata.d.ts +1193 -0
- package/metadata/entity-metadata.js +2502 -0
- package/metadata/entity-metadata.js.map +1 -0
- package/{src → metadata}/local-query-comparison-options.d.ts +65 -59
- package/metadata/local-query-comparison-options.js +69 -0
- package/metadata/local-query-comparison-options.js.map +1 -0
- package/{src → metadata}/naming-convention.d.ts +75 -72
- package/metadata/naming-convention.js +97 -0
- package/metadata/naming-convention.js.map +1 -0
- package/mixins/mixin-get-entity-graph.d.ts +63 -0
- package/{fesm2022/breeze-client-mixin-get-entity-graph.mjs → mixins/mixin-get-entity-graph.js} +331 -253
- package/mixins/mixin-get-entity-graph.js.map +1 -0
- package/mixins/mixin-save-queuing.d.ts +98 -0
- package/{fesm2022/breeze-client-mixin-save-queuing.mjs → mixins/mixin-save-queuing.js} +493 -365
- package/mixins/mixin-save-queuing.js.map +1 -0
- package/package.json +63 -94
- package/query/entity-query.d.ts +521 -0
- package/query/entity-query.js +1149 -0
- package/query/entity-query.js.map +1 -0
- package/{src → query}/mapping-context.d.ts +44 -46
- package/query/mapping-context.js +412 -0
- package/query/mapping-context.js.map +1 -0
- package/query/predicate.d.ts +394 -0
- package/query/predicate.js +1294 -0
- package/query/predicate.js.map +1 -0
- package/query/property-path.d.ts +252 -0
- package/query/property-path.js +2 -0
- package/query/property-path.js.map +1 -0
- package/{src → query}/query-options.d.ts +143 -119
- package/query/query-options.js +180 -0
- package/query/query-options.js.map +1 -0
- package/rxjs/breeze-rxjs.d.ts +72 -0
- package/rxjs/breeze-rxjs.js +117 -0
- package/rxjs/breeze-rxjs.js.map +1 -0
- package/validation/validate.d.ts +583 -0
- package/validation/validate.js +961 -0
- package/validation/validate.js.map +1 -0
- package/{src → validation}/validation-options.d.ts +67 -63
- package/validation/validation-options.js +70 -0
- package/validation/validation-options.js.map +1 -0
- package/adapter-ajax-angularjs/adapter-ajax-angularjs.d.ts +0 -17
- package/adapter-ajax-angularjs/adapter-core.d.ts +0 -4
- package/adapter-ajax-angularjs/index.d.ts +0 -5
- package/adapter-ajax-fetch/adapter-ajax-fetch.d.ts +0 -18
- package/adapter-ajax-fetch/index.d.ts +0 -5
- package/adapter-ajax-httpclient/adapter-ajax-httpclient.d.ts +0 -13
- package/adapter-ajax-httpclient/adapter-core.d.ts +0 -4
- package/adapter-ajax-httpclient/index.d.ts +0 -5
- package/adapter-ajax-jquery/adapter-ajax-jquery.d.ts +0 -15
- package/adapter-ajax-jquery/index.d.ts +0 -5
- package/adapter-ajax-post/index.d.ts +0 -5
- package/adapter-data-service-odata/adapter-core.d.ts +0 -4
- package/adapter-data-service-odata/adapter-data-service-odata.d.ts +0 -17
- package/adapter-data-service-odata/index.d.ts +0 -5
- package/adapter-data-service-webapi/adapter-data-service-webapi.d.ts +0 -15
- package/adapter-data-service-webapi/index.d.ts +0 -5
- package/adapter-model-library-backing-store/adapter-model-library-backing-store.d.ts +0 -10
- package/adapter-model-library-backing-store/index.d.ts +0 -5
- package/adapter-model-library-ko/adapter-model-library-ko.d.ts +0 -10
- package/adapter-model-library-ko/index.d.ts +0 -5
- package/adapter-uri-builder-json/adapter-core.d.ts +0 -4
- package/adapter-uri-builder-json/adapter-uri-builder-json.d.ts +0 -8
- package/adapter-uri-builder-json/index.d.ts +0 -5
- package/adapter-uri-builder-odata/adapter-core.d.ts +0 -4
- package/adapter-uri-builder-odata/adapter-uri-builder-odata.d.ts +0 -8
- package/adapter-uri-builder-odata/index.d.ts +0 -5
- package/esm2022/adapter-ajax-angularjs/adapter-ajax-angularjs.mjs +0 -135
- package/esm2022/adapter-ajax-angularjs/adapter-core.mjs +0 -49
- package/esm2022/adapter-ajax-angularjs/breeze-client-adapter-ajax-angularjs.mjs +0 -5
- package/esm2022/adapter-ajax-fetch/adapter-ajax-fetch.mjs +0 -135
- package/esm2022/adapter-ajax-fetch/adapter-core.mjs +0 -49
- package/esm2022/adapter-ajax-fetch/breeze-client-adapter-ajax-fetch.mjs +0 -5
- package/esm2022/adapter-ajax-httpclient/adapter-ajax-httpclient.mjs +0 -139
- package/esm2022/adapter-ajax-httpclient/adapter-core.mjs +0 -49
- package/esm2022/adapter-ajax-httpclient/breeze-client-adapter-ajax-httpclient.mjs +0 -5
- package/esm2022/adapter-ajax-jquery/adapter-ajax-jquery.mjs +0 -107
- package/esm2022/adapter-ajax-jquery/breeze-client-adapter-ajax-jquery.mjs +0 -5
- package/esm2022/adapter-ajax-post/adapter-ajax-post.mjs +0 -77
- package/esm2022/adapter-ajax-post/breeze-client-adapter-ajax-post.mjs +0 -5
- package/esm2022/adapter-data-service-odata/adapter-core.mjs +0 -49
- package/esm2022/adapter-data-service-odata/adapter-data-service-odata.mjs +0 -461
- package/esm2022/adapter-data-service-odata/breeze-client-adapter-data-service-odata.mjs +0 -5
- package/esm2022/adapter-data-service-webapi/adapter-data-service-webapi.mjs +0 -100
- package/esm2022/adapter-data-service-webapi/breeze-client-adapter-data-service-webapi.mjs +0 -5
- package/esm2022/adapter-model-library-backing-store/adapter-model-library-backing-store.mjs +0 -269
- package/esm2022/adapter-model-library-backing-store/breeze-client-adapter-model-library-backing-store.mjs +0 -5
- package/esm2022/adapter-model-library-ko/adapter-model-library-ko.mjs +0 -241
- package/esm2022/adapter-model-library-ko/breeze-client-adapter-model-library-ko.mjs +0 -5
- package/esm2022/adapter-uri-builder-json/adapter-core.mjs +0 -49
- package/esm2022/adapter-uri-builder-json/adapter-uri-builder-json.mjs +0 -37
- package/esm2022/adapter-uri-builder-json/breeze-client-adapter-uri-builder-json.mjs +0 -5
- package/esm2022/adapter-uri-builder-odata/adapter-core.mjs +0 -49
- package/esm2022/adapter-uri-builder-odata/adapter-uri-builder-odata.mjs +0 -191
- package/esm2022/adapter-uri-builder-odata/breeze-client-adapter-uri-builder-odata.mjs +0 -5
- package/esm2022/breeze-client.mjs +0 -5
- package/esm2022/index.mjs +0 -2
- package/esm2022/mixin-get-entity-graph/breeze-client-mixin-get-entity-graph.mjs +0 -5
- package/esm2022/mixin-get-entity-graph/mixin-get-entity-graph.mjs +0 -269
- package/esm2022/mixin-save-queuing/breeze-client-mixin-save-queuing.mjs +0 -5
- package/esm2022/mixin-save-queuing/mixin-save-queuing.mjs +0 -421
- package/esm2022/src/abstract-data-service-adapter.mjs +0 -325
- package/esm2022/src/array.mjs +0 -4
- package/esm2022/src/assert-param.mjs +0 -330
- package/esm2022/src/breeze.mjs +0 -85
- package/esm2022/src/complex-array.mjs +0 -117
- package/esm2022/src/config.mjs +0 -232
- package/esm2022/src/core.mjs +0 -712
- package/esm2022/src/csdl-metadata-parser.mjs +0 -385
- package/esm2022/src/data-service.mjs +0 -221
- package/esm2022/src/data-type.mjs +0 -510
- package/esm2022/src/default-property-interceptor.mjs +0 -460
- package/esm2022/src/entity-action.mjs +0 -45
- package/esm2022/src/entity-aspect.mjs +0 -897
- package/esm2022/src/entity-group.mjs +0 -192
- package/esm2022/src/entity-key.mjs +0 -125
- package/esm2022/src/entity-manager.mjs +0 -2163
- package/esm2022/src/entity-metadata.mjs +0 -2242
- package/esm2022/src/entity-query.mjs +0 -1024
- package/esm2022/src/entity-state.mjs +0 -107
- package/esm2022/src/enum.mjs +0 -143
- package/esm2022/src/event.mjs +0 -264
- package/esm2022/src/interface-registry.mjs +0 -39
- package/esm2022/src/key-generator.mjs +0 -110
- package/esm2022/src/local-query-comparison-options.mjs +0 -65
- package/esm2022/src/mapping-context.mjs +0 -411
- package/esm2022/src/naming-convention.mjs +0 -92
- package/esm2022/src/observable-array.mjs +0 -183
- package/esm2022/src/predicate.mjs +0 -1259
- package/esm2022/src/primitive-array.mjs +0 -85
- package/esm2022/src/query-options.mjs +0 -152
- package/esm2022/src/relation-array.mjs +0 -173
- package/esm2022/src/save-options.mjs +0 -41
- package/esm2022/src/unattached-children-map.mjs +0 -56
- package/esm2022/src/validate.mjs +0 -995
- package/esm2022/src/validation-options.mjs +0 -64
- package/fesm2022/breeze-client-adapter-ajax-angularjs.mjs +0 -190
- package/fesm2022/breeze-client-adapter-ajax-angularjs.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-fetch.mjs +0 -190
- package/fesm2022/breeze-client-adapter-ajax-fetch.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-httpclient.mjs +0 -194
- package/fesm2022/breeze-client-adapter-ajax-httpclient.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-jquery.mjs +0 -114
- package/fesm2022/breeze-client-adapter-ajax-jquery.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-ajax-post.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-data-service-odata.mjs +0 -516
- package/fesm2022/breeze-client-adapter-data-service-odata.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-data-service-webapi.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-model-library-backing-store.mjs +0 -276
- package/fesm2022/breeze-client-adapter-model-library-backing-store.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-model-library-ko.mjs +0 -248
- package/fesm2022/breeze-client-adapter-model-library-ko.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-uri-builder-json.mjs.map +0 -1
- package/fesm2022/breeze-client-adapter-uri-builder-odata.mjs +0 -246
- package/fesm2022/breeze-client-adapter-uri-builder-odata.mjs.map +0 -1
- package/fesm2022/breeze-client-mixin-get-entity-graph.mjs.map +0 -1
- package/fesm2022/breeze-client-mixin-save-queuing.mjs.map +0 -1
- package/fesm2022/breeze-client.mjs +0 -14144
- package/fesm2022/breeze-client.mjs.map +0 -1
- package/index.d.ts +0 -1
- package/mixin-get-entity-graph/index.d.ts +0 -5
- package/mixin-get-entity-graph/mixin-get-entity-graph.d.ts +0 -31
- package/mixin-save-queuing/index.d.ts +0 -5
- package/mixin-save-queuing/mixin-save-queuing.d.ts +0 -32
- package/src/abstract-data-service-adapter.d.ts +0 -84
- package/src/array.d.ts +0 -3
- package/src/breeze.d.ts +0 -139
- package/src/complex-array.d.ts +0 -13
- package/src/config.d.ts +0 -104
- package/src/core.d.ts +0 -164
- package/src/csdl-metadata-parser.d.ts +0 -7
- package/src/data-type.d.ts +0 -89
- package/src/default-property-interceptor.d.ts +0 -4
- package/src/entity-aspect.d.ts +0 -332
- package/src/entity-group.d.ts +0 -28
- package/src/entity-key.d.ts +0 -77
- package/src/entity-manager.d.ts +0 -680
- package/src/entity-metadata.d.ts +0 -988
- package/src/entity-query.d.ts +0 -444
- package/src/enum.d.ts +0 -100
- package/src/event.d.ts +0 -142
- package/src/interface-registry.d.ts +0 -150
- package/src/key-generator.d.ts +0 -12
- package/src/observable-array.d.ts +0 -52
- package/src/predicate.d.ts +0 -376
- package/src/primitive-array.d.ts +0 -7
- package/src/relation-array.d.ts +0 -18
- package/src/unattached-children-map.d.ts +0 -19
- package/src/validate.d.ts +0 -650
package/src/data-type.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { BreezeEnum } from './enum';
|
|
2
|
-
import { Validator } from './validate';
|
|
3
|
-
/**
|
|
4
|
-
DataType is an 'Enum' containing all of the supported data types.
|
|
5
|
-
@dynamic
|
|
6
|
-
**/
|
|
7
|
-
export declare class DataType extends BreezeEnum {
|
|
8
|
-
/** The default value of this DataType. __Read Only__ **/
|
|
9
|
-
defaultValue?: any;
|
|
10
|
-
/** Whether this is a 'numeric' DataType. __Read Only__ **/
|
|
11
|
-
isNumeric?: boolean;
|
|
12
|
-
/** Whether this is an 'integer' DataType. __Read Only__ **/
|
|
13
|
-
isInteger?: boolean;
|
|
14
|
-
/** Whether to quote the json value when formatting this DataType for OData. */
|
|
15
|
-
quoteJsonOData?: boolean;
|
|
16
|
-
/** The constructor function to create a [[Validator]] to be used in validating instances of this DataType. */
|
|
17
|
-
validatorCtor?(context?: any): Validator;
|
|
18
|
-
/**
|
|
19
|
-
Optional function to normalize a data value for comparison, if its value cannot be used directly.
|
|
20
|
-
Note that this will be called each time a property is changed, so make it fast.
|
|
21
|
-
@return value appropriate for this DataType
|
|
22
|
-
**/
|
|
23
|
-
normalize?(value: any): any;
|
|
24
|
-
/**
|
|
25
|
-
Optional function to convert a raw (server) value from string to this DataType.
|
|
26
|
-
@return value appropriate for this DataType
|
|
27
|
-
**/
|
|
28
|
-
parseRawValue?(value: any): any;
|
|
29
|
-
/**
|
|
30
|
-
Optional function to convert a value from string to this DataType. Note that this will be called each time a property is changed, so make it fast.
|
|
31
|
-
@return value appropriate for this DataType
|
|
32
|
-
**/
|
|
33
|
-
parse?(source: any, sourceTypeName: string): any;
|
|
34
|
-
/**
|
|
35
|
-
Optional function to format this DataType for OData queries.
|
|
36
|
-
@return value appropriate for OData query
|
|
37
|
-
**/
|
|
38
|
-
fmtOData?(value: any): any;
|
|
39
|
-
/**
|
|
40
|
-
Optional function to get the next value for key generation, if this datatype is used as a key. Uses an internal table of previous values.
|
|
41
|
-
@return value appropriate for this DataType
|
|
42
|
-
**/
|
|
43
|
-
getNext?(): any;
|
|
44
|
-
/**
|
|
45
|
-
Optional function to get the next value when the datatype is used as a concurrency property.
|
|
46
|
-
@param previousValue
|
|
47
|
-
@return the next concurrency value, which may be a function of the previousValue.
|
|
48
|
-
**/
|
|
49
|
-
getConcurrencyValue?(previousValue?: any): any;
|
|
50
|
-
static parseDateFromServer: (value: any) => any;
|
|
51
|
-
/** @hidden @internal */
|
|
52
|
-
static constants: {
|
|
53
|
-
stringPrefix: string;
|
|
54
|
-
nextNumber: number;
|
|
55
|
-
nextNumberIncrement: number;
|
|
56
|
-
};
|
|
57
|
-
static String: DataType;
|
|
58
|
-
static Int64: DataType;
|
|
59
|
-
static Int32: DataType;
|
|
60
|
-
static Int16: DataType;
|
|
61
|
-
static Byte: DataType;
|
|
62
|
-
static Decimal: DataType;
|
|
63
|
-
static Double: DataType;
|
|
64
|
-
static Single: DataType;
|
|
65
|
-
static DateOnly: DataType;
|
|
66
|
-
static DateTime: DataType;
|
|
67
|
-
static DateTimeOffset: DataType;
|
|
68
|
-
static Time: DataType;
|
|
69
|
-
static Boolean: DataType;
|
|
70
|
-
static Guid: DataType;
|
|
71
|
-
static Binary: DataType;
|
|
72
|
-
static Undefined: DataType;
|
|
73
|
-
static getComparableFn(dataType?: DataType): (value: any) => any;
|
|
74
|
-
/** Returns the DataType for a specified EDM type name.
|
|
75
|
-
**/
|
|
76
|
-
static fromEdmDataType(typeName: string): DataType;
|
|
77
|
-
/** Returns the DataType for a specified input. */
|
|
78
|
-
static fromValue(val: any): DataType;
|
|
79
|
-
static parseTimeFromServer(source: any): any;
|
|
80
|
-
static parseDateAsUTC(source: any): any;
|
|
81
|
-
/** Parse as UTC then shift to local time */
|
|
82
|
-
static parseDateAsLocal(source: string): any;
|
|
83
|
-
/** if val is a Date, return a date-only string e.g. '2023-12-31' */
|
|
84
|
-
static toDateOnlyString(val: any): any;
|
|
85
|
-
/** Returns a raw value converted to the specified DataType */
|
|
86
|
-
static parseRawValue(val: any, dataType?: DataType): any;
|
|
87
|
-
/** @hidden @internal */
|
|
88
|
-
static _resetConstants(): void;
|
|
89
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { EntityProperty } from './entity-metadata';
|
|
2
|
-
import { StructuralObject } from './entity-aspect';
|
|
3
|
-
/** @hidden @internal */
|
|
4
|
-
export declare function defaultPropertyInterceptor(this: StructuralObject, property: EntityProperty, newValue: any, rawAccessorFn: Function): void;
|
package/src/entity-aspect.d.ts
DELETED
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
import { BreezeEvent } from './event';
|
|
2
|
-
import { EntityState } from './entity-state';
|
|
3
|
-
import { EntityType, ComplexType, DataProperty, NavigationProperty, EntityProperty } from './entity-metadata';
|
|
4
|
-
import { EntityKey } from './entity-key';
|
|
5
|
-
import { EntityGroup } from './entity-group';
|
|
6
|
-
import { EntityManager, QueryResult, QueryErrorCallback, QuerySuccessCallback } from './entity-manager';
|
|
7
|
-
import { ValidationError } from './validate';
|
|
8
|
-
export interface Entity {
|
|
9
|
-
entityAspect: EntityAspect;
|
|
10
|
-
entityType: EntityType;
|
|
11
|
-
/** Get the property with the given name */
|
|
12
|
-
getProperty?(prop: string): any;
|
|
13
|
-
/** Set the property with the given name */
|
|
14
|
-
setProperty?(prop: any, value: any): void;
|
|
15
|
-
/** @hidden @internal */
|
|
16
|
-
prototype?: {
|
|
17
|
-
_$typeName: string;
|
|
18
|
-
};
|
|
19
|
-
/** @hidden @internal */
|
|
20
|
-
_$entityType?: EntityType;
|
|
21
|
-
}
|
|
22
|
-
export interface ComplexObject {
|
|
23
|
-
complexAspect: ComplexAspect;
|
|
24
|
-
complexType: ComplexType;
|
|
25
|
-
getProperty?(prop: string): any;
|
|
26
|
-
setProperty?(prop: any, value: any): void;
|
|
27
|
-
/** @hidden @internal */
|
|
28
|
-
prototype?: {
|
|
29
|
-
_$typeName: string;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
export type StructuralObject = Entity | ComplexObject;
|
|
33
|
-
export interface PropertyChangedEventArgs {
|
|
34
|
-
entity: Entity;
|
|
35
|
-
propertyName: string | null;
|
|
36
|
-
parent?: StructuralObject;
|
|
37
|
-
property?: EntityProperty;
|
|
38
|
-
oldValue?: any;
|
|
39
|
-
newValue?: any;
|
|
40
|
-
}
|
|
41
|
-
export interface ValidationErrorsChangedEventArgs {
|
|
42
|
-
entity: Entity;
|
|
43
|
-
added: ValidationError[];
|
|
44
|
-
removed: ValidationError[];
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
An EntityAspect instance is associated with every attached entity and is accessed via the entity's 'entityAspect' property.
|
|
48
|
-
|
|
49
|
-
The EntityAspect itself provides properties to determine and modify the EntityState of the entity and has methods
|
|
50
|
-
that provide a variety of services including validation and change tracking.
|
|
51
|
-
|
|
52
|
-
An EntityAspect will almost never need to be constructed directly. You will usually get an EntityAspect by accessing
|
|
53
|
-
an entities 'entityAspect' property. This property will be automatically attached when an entity is created via either
|
|
54
|
-
a query, import or [[EntityManager.createEntity]] call.
|
|
55
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
56
|
-
> var aspect = order.entityAspect;
|
|
57
|
-
> var currentState = aspect.entityState;
|
|
58
|
-
|
|
59
|
-
**/
|
|
60
|
-
export declare class EntityAspect {
|
|
61
|
-
/** The Entity that this aspect is associated with. __Read Only__ **/
|
|
62
|
-
entity?: Entity;
|
|
63
|
-
/** The [[EntityManager]] that contains this entity. __Read Only__ **/
|
|
64
|
-
entityManager?: EntityManager;
|
|
65
|
-
/** @hidden @internal */
|
|
66
|
-
entityGroup?: EntityGroup;
|
|
67
|
-
/** The [[EntityState]] of this entity. __Read Only__ **/
|
|
68
|
-
entityState: EntityState;
|
|
69
|
-
/** Whether this entity is in the process of being saved. __Read Only__ */
|
|
70
|
-
isBeingSaved: boolean;
|
|
71
|
-
/** The 'original values' of this entity where they are different from the 'current values'.
|
|
72
|
-
This is a map where the key is a property name and the value is the 'original value' of the property. */
|
|
73
|
-
originalValues: Record<string, any>;
|
|
74
|
-
/** Whether this entity has any validation errors. __Read Only__ */
|
|
75
|
-
hasValidationErrors: boolean;
|
|
76
|
-
/** Whether this entity has a temporary [[EntityKey]]. */
|
|
77
|
-
hasTempKey: boolean;
|
|
78
|
-
/** Whether this entity was created by being loaded from the database */
|
|
79
|
-
wasLoaded?: boolean;
|
|
80
|
-
/** Extra metadata about this entity such as the entity's etag.
|
|
81
|
-
You may extend this object with your own metadata information.
|
|
82
|
-
Breeze (de)serializes this object when importing/exporting the entity. **/
|
|
83
|
-
extraMetadata?: any;
|
|
84
|
-
/**
|
|
85
|
-
A [[BreezeEvent]] that fires whenever any of the validation errors on this entity change.
|
|
86
|
-
Note that this might be the removal of an error when some data on the entity is fixed.
|
|
87
|
-
@eventArgs -
|
|
88
|
-
- entity - The entity on which the validation errors are being added or removed.
|
|
89
|
-
- added - An array containing any newly added [[ValidationError]]s
|
|
90
|
-
- removed - An array containing any newly removed [[ValidationError]]s. This is those
|
|
91
|
-
errors that have been 'fixed'.
|
|
92
|
-
|
|
93
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
94
|
-
> order.entityAspect.validationErrorsChanged.subscribe(
|
|
95
|
-
> function (validationChangeArgs) {
|
|
96
|
-
> // this code will be executed anytime a property value changes on the 'order' entity.
|
|
97
|
-
> var entity == validationChangeArgs.entity; // Note: entity === order
|
|
98
|
-
> var errorsAdded = validationChangeArgs.added;
|
|
99
|
-
> var errorsCleared = validationChangeArgs.removed;
|
|
100
|
-
> });
|
|
101
|
-
@event
|
|
102
|
-
**/
|
|
103
|
-
validationErrorsChanged: BreezeEvent<ValidationErrorsChangedEventArgs>;
|
|
104
|
-
/**
|
|
105
|
-
A [[BreezeEvent]] that fires whenever a value of one of this entity's properties change.
|
|
106
|
-
@eventArgs -
|
|
107
|
-
- entity - The entity whose property has changed.
|
|
108
|
-
- property - The [[DataProperty]] that changed.
|
|
109
|
-
- propertyName - The name of the property that changed. This value will be 'null' for operations that replace the entire entity. This includes
|
|
110
|
-
queries, imports and saves that require a merge. The remaining parameters will not exist in this case either. This will actually be a "property path"
|
|
111
|
-
for any properties of a complex type.
|
|
112
|
-
- oldValue - The old value of this property before the change.
|
|
113
|
-
- newValue - The new value of this property after the change.
|
|
114
|
-
- parent - The immediate parent object for the changed property. This will be a ComplexType instance as opposed to an Entity
|
|
115
|
-
for any complex type or nested complex type properties.
|
|
116
|
-
|
|
117
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
118
|
-
> order.entityAspect.propertyChanged.subscribe(
|
|
119
|
-
> function (propertyChangedArgs) {
|
|
120
|
-
> // this code will be executed anytime a property value changes on the 'order' entity.
|
|
121
|
-
> var entity = propertyChangedArgs.entity; // Note: entity === order
|
|
122
|
-
> var propertyNameChanged = propertyChangedArgs.propertyName;
|
|
123
|
-
> var oldValue = propertyChangedArgs.oldValue;
|
|
124
|
-
> var newValue = propertyChangedArgs.newValue;
|
|
125
|
-
> });
|
|
126
|
-
@event
|
|
127
|
-
**/
|
|
128
|
-
propertyChanged: BreezeEvent<PropertyChangedEventArgs>;
|
|
129
|
-
/** @hidden @internal */
|
|
130
|
-
_validationErrors: {
|
|
131
|
-
[index: string]: ValidationError;
|
|
132
|
-
};
|
|
133
|
-
/** @hidden @internal */
|
|
134
|
-
_pendingValidationResult: any;
|
|
135
|
-
/** @hidden @internal */
|
|
136
|
-
_entityKey: EntityKey;
|
|
137
|
-
/** @hidden @internal */
|
|
138
|
-
_loadedNps: any[];
|
|
139
|
-
/** @hidden @internal */
|
|
140
|
-
_initialized?: boolean;
|
|
141
|
-
/** @hidden @internal */
|
|
142
|
-
_inProcess: any[];
|
|
143
|
-
/** @hidden @internal */
|
|
144
|
-
_inProcessEntity?: Entity;
|
|
145
|
-
/** @hidden @internal */
|
|
146
|
-
static _nullInstance: EntityAspect;
|
|
147
|
-
/** @hidden @internal */
|
|
148
|
-
constructor(entity?: Entity);
|
|
149
|
-
/** @hidden */
|
|
150
|
-
static isEntity(obj: StructuralObject): obj is Entity;
|
|
151
|
-
/**
|
|
152
|
-
Returns the value of a specified 'property path' for a specified entity.
|
|
153
|
-
|
|
154
|
-
The propertyPath can be either a string delimited with '.' or a string array.
|
|
155
|
-
**/
|
|
156
|
-
static getPropertyPathValue(obj: Entity, propertyPath: string | string[]): any;
|
|
157
|
-
/**
|
|
158
|
-
Returns the [[EntityKey]] for this Entity.
|
|
159
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
160
|
-
> var entityKey = order.entityAspect.getKey();
|
|
161
|
-
@param forceRefresh - (boolean=false) Forces the recalculation of the key. This should normally be unnecessary.
|
|
162
|
-
@return The [[EntityKey]] associated with this Entity.
|
|
163
|
-
**/
|
|
164
|
-
getKey(forceRefresh?: boolean): EntityKey;
|
|
165
|
-
/**
|
|
166
|
-
Returns the entity to an [[EntityState]] of 'Unchanged' by committing all changes made since the entity was last queried
|
|
167
|
-
had 'acceptChanges' called on it.
|
|
168
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
169
|
-
> order.entityAspect.acceptChanges();
|
|
170
|
-
> // The 'order' entity will now be in an 'Unchanged' state with any changes committed.
|
|
171
|
-
**/
|
|
172
|
-
acceptChanges(): void;
|
|
173
|
-
/**
|
|
174
|
-
Returns the entity to an [[EntityState]] of 'Unchanged' by rejecting all changes made to it since the entity was last queried
|
|
175
|
-
had 'rejectChanges' called on it.
|
|
176
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
177
|
-
> order.entityAspect.rejectChanges();
|
|
178
|
-
> // The 'order' entity will now be in an 'Unchanged' state with any changes rejected.
|
|
179
|
-
**/
|
|
180
|
-
rejectChanges(): void;
|
|
181
|
-
/** @hidden @internal */
|
|
182
|
-
getPropertyPath(propName: string): string;
|
|
183
|
-
/**
|
|
184
|
-
Sets the entity to an EntityState of 'Added'. This is NOT the equivalent of calling [[EntityManager.addEntity]]
|
|
185
|
-
because no key generation will occur for autogenerated keys as a result of this operation. As a result this operation can be problematic
|
|
186
|
-
unless you are certain that the entity being marked 'Added' does not already exist in the database and does not have an autogenerated key.
|
|
187
|
-
The same operation can be performed by calling [[EntityAspect.setEntityState]].
|
|
188
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
189
|
-
> order.entityAspect.setAdded();
|
|
190
|
-
> // The 'order' entity will now be in an 'Added' state.
|
|
191
|
-
**/
|
|
192
|
-
setAdded(): boolean;
|
|
193
|
-
/**
|
|
194
|
-
Sets the entity to an EntityState of 'Unchanged'. This is also the equivalent of calling [[EntityAspect.acceptChanges]].
|
|
195
|
-
The same operation can be performed by calling [[EntityAspect.setEntityState]].
|
|
196
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
197
|
-
> order.entityAspect.setUnchanged();
|
|
198
|
-
> // The 'order' entity will now be in an 'Unchanged' state with any changes committed.
|
|
199
|
-
**/
|
|
200
|
-
setUnchanged: () => any;
|
|
201
|
-
/**
|
|
202
|
-
Sets the entity to an EntityState of 'Modified'. This can also be achieved by changing the value of any property on an 'Unchanged' entity.
|
|
203
|
-
The same operation can be performed by calling [[EntityAspect.setEntityState]].
|
|
204
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
205
|
-
> order.entityAspect.setModified();
|
|
206
|
-
> // The 'order' entity will now be in a 'Modified' state.
|
|
207
|
-
**/
|
|
208
|
-
setModified: () => any;
|
|
209
|
-
/**
|
|
210
|
-
Sets the entity to an EntityState of 'Deleted'. This both marks the entity as being scheduled for deletion during the next 'Save' call
|
|
211
|
-
but also removes the entity from all of its related entities. If the current entityState is 'Added', then `setDeleted()` will mark it 'Detached'
|
|
212
|
-
The same operation can be performed by calling [[EntityAspect.setEntityState]].
|
|
213
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
214
|
-
> order.entityAspect.setDeleted();
|
|
215
|
-
> // The 'order' entity will now be in a 'Deleted' state and it will no longer have any 'related' entities.
|
|
216
|
-
**/
|
|
217
|
-
setDeleted: () => any;
|
|
218
|
-
/**
|
|
219
|
-
Sets the entity to an EntityState of 'Detached'. This removes the entity from all of its related entities, but does NOT change the EntityState of any existing entities.
|
|
220
|
-
The same operation can be performed by calling [[EntityAspect.setEntityState]].
|
|
221
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
222
|
-
> order.entityAspect.setDetached();
|
|
223
|
-
> // The 'order' entity will now be in a 'Detached' state and it will no longer have any 'related' entities.
|
|
224
|
-
**/
|
|
225
|
-
setDetached: () => any;
|
|
226
|
-
/**
|
|
227
|
-
Sets the entity to the specified EntityState. See also 'setUnchanged', 'setModified', 'setDetached', etc.
|
|
228
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
229
|
-
> order.entityAspect.setEntityState(EntityState.Unchanged);
|
|
230
|
-
> // The 'order' entity will now be in a 'Unchanged' state.
|
|
231
|
-
**/
|
|
232
|
-
setEntityState(entityState: EntityState): boolean;
|
|
233
|
-
loadNavigationProperty(navigationProperty: string, callback?: QuerySuccessCallback, errorCallback?: QueryErrorCallback): Promise<QueryResult>;
|
|
234
|
-
loadNavigationProperty(navigationProperty: NavigationProperty, callback?: QuerySuccessCallback, errorCallback?: QueryErrorCallback): Promise<QueryResult>;
|
|
235
|
-
/**
|
|
236
|
-
Marks this navigationProperty on this entity as already having been loaded.
|
|
237
|
-
> emp.entityAspect.markNavigationPropertyAsLoaded("Orders");
|
|
238
|
-
@param navigationProperty - The NavigationProperty or name of NavigationProperty to 'load'.
|
|
239
|
-
**/
|
|
240
|
-
markNavigationPropertyAsLoaded(navigationProperty: NavigationProperty | string): void;
|
|
241
|
-
isNavigationPropertyLoaded(navigationProperty: string): boolean;
|
|
242
|
-
isNavigationPropertyLoaded(navigationProperty: NavigationProperty): boolean;
|
|
243
|
-
/** @hidden @internal */
|
|
244
|
-
_markAsLoaded(navPropName: string): void;
|
|
245
|
-
/**
|
|
246
|
-
Performs validation on the entity, any errors encountered during the validation are available via the
|
|
247
|
-
[[EntityAspect.getValidationErrors]] method. Validating an entity means executing
|
|
248
|
-
all of the validators on both the entity itself as well as those on each of its properties.
|
|
249
|
-
> // assume order is an order entity attached to an EntityManager.
|
|
250
|
-
> var isOk = order.entityAspect.validateEntity();
|
|
251
|
-
> // isOk will be 'true' if there are no errors on the entity.
|
|
252
|
-
> if (!isOk) {
|
|
253
|
-
> var errors = order.entityAspect.getValidationErrors();
|
|
254
|
-
> }
|
|
255
|
-
@return Whether the entity passed validation.
|
|
256
|
-
**/
|
|
257
|
-
validateEntity(): boolean;
|
|
258
|
-
validateProperty(property: string, context?: any): boolean;
|
|
259
|
-
validateProperty(property: DataProperty, context?: any): boolean;
|
|
260
|
-
validateProperty(property: NavigationProperty, context?: any): boolean;
|
|
261
|
-
getValidationErrors(): ValidationError[];
|
|
262
|
-
getValidationErrors(property: string): ValidationError[];
|
|
263
|
-
getValidationErrors(property: EntityProperty): ValidationError[];
|
|
264
|
-
/**
|
|
265
|
-
Adds a validation error.
|
|
266
|
-
**/
|
|
267
|
-
addValidationError(validationError: ValidationError): void;
|
|
268
|
-
removeValidationError(validationError: ValidationError): void;
|
|
269
|
-
removeValidationError(validationKey: string): void;
|
|
270
|
-
/**
|
|
271
|
-
Removes all of the validation errors for a specified entity
|
|
272
|
-
**/
|
|
273
|
-
clearValidationErrors(): void;
|
|
274
|
-
/**
|
|
275
|
-
Returns an [[EntityKey]] for the entity pointed to by the specified scalar NavigationProperty.
|
|
276
|
-
This only returns an EntityKey if the current entity is a 'child' entity along the specified NavigationProperty.
|
|
277
|
-
i.e. has a single parent.
|
|
278
|
-
|
|
279
|
-
@param navigationProperty - The [[NavigationProperty]] ( pointing to a parent).
|
|
280
|
-
@returns Either a parent EntityKey if this is a 'child' entity or null;
|
|
281
|
-
*/
|
|
282
|
-
getParentKey(navigationProperty: NavigationProperty): EntityKey;
|
|
283
|
-
/**
|
|
284
|
-
Returns the value of a specified DataProperty or NavigationProperty or 'property path'.
|
|
285
|
-
**/
|
|
286
|
-
getPropertyValue(property: string | DataProperty | NavigationProperty): any;
|
|
287
|
-
/** @hidden @internal */
|
|
288
|
-
_checkOperation(operationName: string): this;
|
|
289
|
-
/** @hidden @internal */
|
|
290
|
-
_detach(): void;
|
|
291
|
-
/** @hidden @internal */
|
|
292
|
-
_validateProperty(value: any, context: any): boolean;
|
|
293
|
-
/** @hidden @internal */
|
|
294
|
-
_processValidationOpAndPublish(validationFn: any): void;
|
|
295
|
-
/** @hidden @internal */
|
|
296
|
-
_addValidationError(validationError: any): void;
|
|
297
|
-
/** @hidden @internal */
|
|
298
|
-
_removeValidationError(key: string): void;
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
An ComplexAspect instance is associated with every complex object instance and is accessed via the complex object's 'complexAspect' property.
|
|
302
|
-
|
|
303
|
-
The ComplexAspect itself provides properties to determine the parent object, parent property and original values for the complex object.
|
|
304
|
-
|
|
305
|
-
A ComplexAspect will almost never need to be constructed directly. You will usually get an ComplexAspect by accessing
|
|
306
|
-
an entities 'complexAspect' property. This property will be automatically attached when an complex object is created as part of an
|
|
307
|
-
entity via either a query, import or EntityManager.createEntity call.
|
|
308
|
-
> // assume address is a complex property on the 'Customer' type
|
|
309
|
-
> var aspect = aCustomer.address.complexAspect;
|
|
310
|
-
> // aCustomer === aspect.parent;
|
|
311
|
-
**/
|
|
312
|
-
export declare class ComplexAspect {
|
|
313
|
-
/** The complex object that this aspect is associated with. __Read Only__ */
|
|
314
|
-
complexObject: ComplexObject;
|
|
315
|
-
/** The 'original values' of this complex object where they are different from the 'current values'.
|
|
316
|
-
This is a map where the key is a property name and the value is the 'original value' of the property.
|
|
317
|
-
__Read Only__ */
|
|
318
|
-
originalValues: Record<string, any>;
|
|
319
|
-
/** The parent object that to which this aspect belongs; this will either be an entity or another complex object. __Read Only__ */
|
|
320
|
-
parent?: StructuralObject;
|
|
321
|
-
/** The [[DataProperty]] on the 'parent' that contains this complex object. __Read Only__ */
|
|
322
|
-
parentProperty?: DataProperty;
|
|
323
|
-
extraMetadata?: any;
|
|
324
|
-
/** You will rarely, if ever, create a ComplexAspect directly. */
|
|
325
|
-
constructor(complexObject: ComplexObject, parent: StructuralObject, parentProperty: DataProperty);
|
|
326
|
-
/**
|
|
327
|
-
Returns the EntityAspect for the top level entity that contains this complex object.
|
|
328
|
-
**/
|
|
329
|
-
getEntityAspect(): any;
|
|
330
|
-
/** @hidden @internal */
|
|
331
|
-
getPropertyPath(propName: string): any;
|
|
332
|
-
}
|
package/src/entity-group.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Entity } from './entity-aspect';
|
|
2
|
-
import { EntityType, DataProperty } from './entity-metadata';
|
|
3
|
-
import { EntityKey } from './entity-key';
|
|
4
|
-
import { EntityState } from './entity-state';
|
|
5
|
-
import { EntityManager } from './entity-manager';
|
|
6
|
-
import { MergeStrategy } from './query-options';
|
|
7
|
-
/** @hidden @internal */
|
|
8
|
-
export declare class EntityGroup {
|
|
9
|
-
entityManager: EntityManager;
|
|
10
|
-
entityType: EntityType;
|
|
11
|
-
_indexMap: {
|
|
12
|
-
[index: string]: number;
|
|
13
|
-
};
|
|
14
|
-
_entities: (Entity | null)[];
|
|
15
|
-
_emptyIndexes: number[];
|
|
16
|
-
constructor(entityManager: EntityManager, entityType: EntityType);
|
|
17
|
-
attachEntity(entity: Entity, entityState: EntityState, mergeStrategy?: MergeStrategy): Entity;
|
|
18
|
-
detachEntity(entity: Entity): Entity;
|
|
19
|
-
findEntityByKey(entityKey: EntityKey): Entity;
|
|
20
|
-
hasChanges(): boolean;
|
|
21
|
-
getChanges(): Entity[];
|
|
22
|
-
getEntities(entityStates: EntityState[]): Entity[];
|
|
23
|
-
_checkOperation(operationName: string): this;
|
|
24
|
-
_clear(): void;
|
|
25
|
-
_updateFkVal(fkProp: DataProperty, oldValue: any, newValue: any): void;
|
|
26
|
-
_fixupKey(tempValue: any, realValue: any): void;
|
|
27
|
-
_replaceKey(oldKey: EntityKey, newKey: EntityKey): void;
|
|
28
|
-
}
|
package/src/entity-key.d.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { EntityType, MetadataStore } from './entity-metadata';
|
|
2
|
-
/**
|
|
3
|
-
An EntityKey is an object that represents the unique identity of an entity. EntityKey's are immutable.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
**/
|
|
7
|
-
export declare class EntityKey {
|
|
8
|
-
/** @hidden @internal */
|
|
9
|
-
_$typeName: string;
|
|
10
|
-
/** @hidden @internal */
|
|
11
|
-
static ENTITY_KEY_DELIMITER: string;
|
|
12
|
-
/** The 'EntityType' that this is a key for. __Read Only__ */
|
|
13
|
-
entityType: EntityType;
|
|
14
|
-
/** An array of the values for this key. This will usually only have a single element,
|
|
15
|
-
unless the entity type has a multipart key. __Read Only__ */
|
|
16
|
-
values: any[];
|
|
17
|
-
/** @hidden @internal */
|
|
18
|
-
_keyInGroup: string;
|
|
19
|
-
/** @hidden @internal */
|
|
20
|
-
_subtypes: EntityType[];
|
|
21
|
-
/**
|
|
22
|
-
Constructs a new EntityKey. Each entity within an EntityManager will have a unique EntityKey.
|
|
23
|
-
> // assume em1 is an EntityManager containing a number of existing entities.
|
|
24
|
-
> var empType = em1.metadataStore.getEntityType("Employee");
|
|
25
|
-
> var entityKey = new EntityKey(empType, 1);
|
|
26
|
-
|
|
27
|
-
EntityKey's may also be found by calling EntityAspect.getKey()
|
|
28
|
-
> // assume employee1 is an existing Employee entity
|
|
29
|
-
> var empKey = employee1.entityAspect.getKey();
|
|
30
|
-
|
|
31
|
-
Multipart keys are created by passing an array as the 'keyValues' parameter
|
|
32
|
-
> var empTerrType = em1.metadataStore.getEntityType("EmployeeTerritory");
|
|
33
|
-
> var empTerrKey = new EntityKey(empTerrType, [ 1, 77]);
|
|
34
|
-
> // The order of the properties in the 'keyValues' array must be the same as that
|
|
35
|
-
> // returned by empTerrType.keyProperties
|
|
36
|
-
@param entityType - The [[EntityType]] of the entity.
|
|
37
|
-
@param keyValues - A single value or an array of values.
|
|
38
|
-
*/
|
|
39
|
-
constructor(entityType: EntityType, keyValues: any);
|
|
40
|
-
toJSON(): {
|
|
41
|
-
entityType: string;
|
|
42
|
-
values: any[];
|
|
43
|
-
};
|
|
44
|
-
static fromJSON(json: any, metadataStore: MetadataStore): EntityKey;
|
|
45
|
-
/**
|
|
46
|
-
Used to compare EntityKeys are determine if they refer to the same Entity.
|
|
47
|
-
There is also an static version of 'equals' with the same functionality.
|
|
48
|
-
|
|
49
|
-
> // assume em1 is an EntityManager containing a number of existing entities.
|
|
50
|
-
> var empType = em1.metadataStore.getEntityType("Employee");
|
|
51
|
-
> var empKey1 = new EntityKey(empType, 1);
|
|
52
|
-
> // assume employee1 is an existing Employee entity
|
|
53
|
-
> var empKey2 = employee1.entityAspect.getKey();
|
|
54
|
-
> if (empKey1.equals(empKey2)) {
|
|
55
|
-
> // do something ...
|
|
56
|
-
> }
|
|
57
|
-
**/
|
|
58
|
-
equals(entityKey: EntityKey): boolean;
|
|
59
|
-
toString(altEntityType?: EntityType): string;
|
|
60
|
-
/**
|
|
61
|
-
Used to compare EntityKeys are determine if they refer to the same Entity.
|
|
62
|
-
There is also an instance version of 'equals' with the same functionality.
|
|
63
|
-
> // assume em1 is an EntityManager containing a number of existing entities.
|
|
64
|
-
> var empType = em1.metadataStore.getEntityType("Employee");
|
|
65
|
-
> var empKey1 = new EntityKey(empType, 1);
|
|
66
|
-
> // assume employee1 is an existing Employee entity
|
|
67
|
-
> var empKey2 = employee1.entityAspect.getKey();
|
|
68
|
-
> if (EntityKey.equals(empKey1, empKey2)) {
|
|
69
|
-
> // do something ...
|
|
70
|
-
> }
|
|
71
|
-
**/
|
|
72
|
-
static equals(k1: EntityKey, k2: EntityKey): boolean;
|
|
73
|
-
/** @hidden @internal */
|
|
74
|
-
_isEmpty(): boolean;
|
|
75
|
-
/** hidden */
|
|
76
|
-
static createKeyString(keyValues: any[]): string;
|
|
77
|
-
}
|