@trudb/tru-common-lib 0.0.380 → 0.0.382
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/esm2020/lib/services/tru-entity-accessor.mjs +11 -1
- package/fesm2015/trudb-tru-common-lib.mjs +10 -0
- package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
- package/fesm2020/trudb-tru-common-lib.mjs +10 -0
- package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/services/tru-entity-accessor.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1424,6 +1424,16 @@ class TruEntityAccessor {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
return of(this.formatQueryChoices(query, this._entityManager.executeQueryLocally(query), pkeyName, null));
|
|
1426
1426
|
};
|
|
1427
|
+
this.getByRef = (entity, ref) => {
|
|
1428
|
+
const pkeyName = entity.name + 'Ref';
|
|
1429
|
+
var queryOptions = this._entityManager.queryOptions.using({
|
|
1430
|
+
fetchStrategy: FetchStrategy.FromServer
|
|
1431
|
+
});
|
|
1432
|
+
var query = this._breezeContext.createQuery(this.getQueryServiceName(entity)).where(entity.name + 'Ref', '==', ref).using(queryOptions);
|
|
1433
|
+
return defer(() => from(this._entityManager.executeQuery(query).then((queryData) => {
|
|
1434
|
+
return this.formatQueryChoices(query, queryData.results, pkeyName, null);
|
|
1435
|
+
})));
|
|
1436
|
+
};
|
|
1427
1437
|
this.getByRefCacheOnly = (entity, ref, includeDeleted = false) => {
|
|
1428
1438
|
if (!includeDeleted)
|
|
1429
1439
|
includeDeleted = false;
|