ListNode的composeOperation暂时不包括filter
This commit is contained in:
parent
19d248b1c1
commit
ce835e72a1
|
|
@ -827,11 +827,7 @@ class ListNode extends Node {
|
|||
const { filter, ...rest } = operation;
|
||||
return {
|
||||
entity: this.entity,
|
||||
operation: {
|
||||
...rest,
|
||||
// 加上instrinstic filter有机率降低后台各种检查对数据库的访问(先决条件已经满足约束)
|
||||
filter: combineFilters(this.entity, this.schema, [filter, intrinsticFilter]),
|
||||
}
|
||||
operation
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
@ -844,10 +840,10 @@ class ListNode extends Node {
|
|||
} */
|
||||
return projection;
|
||||
}
|
||||
constructFilters(withParent, ignoreNewParent, ignoreUnapplied, onlyIntrinstic) {
|
||||
constructFilters(withParent, ignoreNewParent, ignoreUnapplied) {
|
||||
const { filters: ownFilters } = this;
|
||||
const filters = ownFilters.filter(ele => (!ignoreUnapplied || ele.applied === true || ele.applied === undefined) // 如果是undefined,说明不可以移除(构造时就存在),也得返回
|
||||
&& (!onlyIntrinstic || ele.applied === undefined)).map((ele) => {
|
||||
).map((ele) => {
|
||||
const { filter } = ele;
|
||||
if (typeof filter === 'function') {
|
||||
return filter();
|
||||
|
|
@ -1004,7 +1000,7 @@ class ListNode extends Node {
|
|||
}
|
||||
// 查看这个list上所有数据必须遵守的限制
|
||||
getIntrinsticFilters() {
|
||||
const filters = this.constructFilters(undefined, true, true, true);
|
||||
const filters = this.constructFilters(undefined, true, true);
|
||||
return combineFilters(this.entity, this.schema, filters || []);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1030,11 +1030,13 @@ class ListNode<
|
|||
const { filter, ...rest } = operation;
|
||||
return {
|
||||
entity: this.entity,
|
||||
/* 现在update有一对多或者多对一的外键对象,oak-db会报错,暂时先封掉
|
||||
operation: {
|
||||
...rest,
|
||||
// 加上instrinstic filter有机率降低后台各种检查对数据库的访问(先决条件已经满足约束)
|
||||
filter: combineFilters(this.entity, this.schema, [filter, intrinsticFilter]),
|
||||
}
|
||||
} */
|
||||
operation
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
@ -1050,11 +1052,10 @@ class ListNode<
|
|||
return projection;
|
||||
}
|
||||
|
||||
private constructFilters(withParent?: boolean, ignoreNewParent?: boolean, ignoreUnapplied?: true, onlyIntrinstic?: true) {
|
||||
private constructFilters(withParent?: boolean, ignoreNewParent?: boolean, ignoreUnapplied?: true) {
|
||||
const { filters: ownFilters } = this;
|
||||
const filters = ownFilters.filter(
|
||||
ele => (!ignoreUnapplied || ele.applied === true || ele.applied === undefined) // 如果是undefined,说明不可以移除(构造时就存在),也得返回
|
||||
&& (!onlyIntrinstic || ele.applied === undefined)
|
||||
ele => (!ignoreUnapplied || ele.applied === true || ele.applied === undefined) // 如果是undefined,说明不可以移除(构造时就存在),也得返回
|
||||
).map((ele) => {
|
||||
const { filter } = ele;
|
||||
if (typeof filter === 'function') {
|
||||
|
|
@ -1242,7 +1243,7 @@ class ListNode<
|
|||
|
||||
// 查看这个list上所有数据必须遵守的限制
|
||||
getIntrinsticFilters() {
|
||||
const filters = this.constructFilters(undefined, true, true, true);
|
||||
const filters = this.constructFilters(undefined, true, true);
|
||||
return combineFilters(this.entity, this.schema, filters || []);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue