⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 embeddedselect.query

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 QUERY
📖 第 1 页 / 共 2 页
字号:
#==============================================================# Testcases for applyProjection with embedded objects.## NOTE: ONLY use this file for applyProjection testcases.#==============================================================#==============================================================# Properties at the FROM class level#==============================================================# Simple propertiesSELECT EmbObjBase FROM CQL_EmbeddedSubClassSELECT EmbObjSub FROM CQL_EmbeddedSubClass# Good scoping classSELECT CQL_EmbeddedSubClass::EmbObjBase FROM CQL_EmbeddedSubClassSELECT CQL_EmbeddedBase::EmbObjSub FROM CQL_EmbeddedSubClass# Bad scoping class# Result: the instance of the FROM class will be emptied SELECT CQL_NonExistent::EmbObjBase FROM CQL_EmbeddedSubClass# One good scoping class, one bad scoping class# Result: only EmbObjSub is projected   SELECT CQL_NonExistent::EmbObjBase, CQL_EmbeddedBase::EmbObjSub FROM CQL_EmbeddedSubClass# Combine bad scoping class, and one simple property# Result: only EmbObjBase is projected   SELECT CQL_NonExistent::EmbObjBase, EmbObjBase FROM CQL_EmbeddedSubClass# Combine good scoping class, and one simple propertySELECT EmbObjSub, CQL_EmbeddedSubClass::EmbObjBase FROM CQL_EmbeddedSubClass#==============================================================# Wildcard at FROM class level, and properties at the FROM level.## The result of all of these is to project every property# in the tree below the FROM class.#==============================================================  # Just a wildcardSELECT * FROM CQL_EmbeddedSubClass# With simple propertiesSELECT *, EmbObjSub FROM CQL_EmbeddedSubClass# With good scoping classSELECT CQL_EmbeddedBase::EmbObjSub, * FROM CQL_EmbeddedSubClass# With bad scoping classSELECT *, CQL_NonExistent::EmbObjBase FROM CQL_EmbeddedSubClass# With one good scoping class, one bad scoping classSELECT CQL_NonExistent::EmbObjBase, *, CQL_EmbeddedBase::EmbObjSub FROM CQL_EmbeddedSubClass# With one bad scoping class, and one simple propertySELECT CQL_NonExistent::EmbObjBase, EmbObjBase, * FROM CQL_EmbeddedSubClass# With one good scoping class, and one simple propertySELECT *, EmbObjSub, CQL_EmbeddedSubClass::EmbObjBase FROM CQL_EmbeddedSubClass#==============================================================# Properties at the second level#==============================================================# Simple propertiesSELECT EmbObjBase.CQL_EmbeddedTestElement::CS FROM CQL_EmbeddedSubClassSELECT EmbObjBase.CQL_EmbeddedTestElement::TEArray FROM CQL_EmbeddedSubClassSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT FROM CQL_EmbeddedSubClassSELECT EmbObjBase.CQL_EmbeddedTestElement::SomeClass FROM CQL_EmbeddedSubClass# Bad scoping classes# Result: instance of the FROM class is emptiedSELECT EmbObjSub.CQL_NonExistent::TPT, EmbObjSub.CQL_NonExistent::CS FROM CQL_EmbeddedSubClass# One good scoping class, one bad scoping class# Result: ignore the bad scope, project CSSELECT EmbObjSub.CQL_NonExistent::TPT, EmbObjSub.CQL_EmbeddedTestPropertyTypes::CS FROM CQL_EmbeddedSubClass# Combine bad scoping classes, and the embedded object itself# Result: ignore the bad scopes, project EmbObjSubSELECT EmbObjSub.CQL_NonExistent::CS, EmbObjSub.CQL_NonExistent::TPT, EmbObjSub FROM CQL_EmbeddedSubClass# Combine one good scoping class, one bad scoping class, and the embedded object itself# Result: ignore the bad scope, project EmbObjSubSELECT EmbObjSub.CQL_NonExistent::TPT, EmbObjSub, EmbObjSub.CQL_EmbeddedTestPropertyTypes::CS FROM CQL_EmbeddedSubClass#==============================================================# Wildcard at the second level, and properties at the second level.## The result of all of these is to project every property# in the tree below the second level#==============================================================  # Good scoping classes# Result: project every property in the tree below EmbObjSub SELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT, EmbObjSub.CQL_EmbeddedTestElement::TE, EmbObjSub.CQL_EmbeddedTestPropertyTypes::CS, EmbObjSub.* FROM CQL_EmbeddedSubClass# Bad scoping classes# Result: project every property in the tree below EmbObjSub SELECT EmbObjSub.*, EmbObjSub.CQL_NonExistent::TPT, EmbObjSub.CQL_NonExistent::CS FROM CQL_EmbeddedSubClass# One good scoping class, one bad scoping class# Result: project every property in the tree below EmbObjSub SELECT EmbObjSub.CQL_NonExistent::TPT, EmbObjSub.*, EmbObjSub.CQL_EmbeddedTestPropertyTypes::CS FROM CQL_EmbeddedSubClass# Combine bad scoping classes, and the embedded object itself# Result: project every property in the tree below EmbObjSub SELECT EmbObjSub.CQL_NonExistent::CS, EmbObjSub.*, EmbObjSub.CQL_NonExistent::TPT, EmbObjSub FROM CQL_EmbeddedSubClass# Combine one good scoping class, one bad scoping class, and the embedded object itself# Result: project every property in the tree below EmbObjSub SELECT EmbObjSub.CQL_NonExistent::TPT, EmbObjSub, EmbObjSub.CQL_EmbeddedTestPropertyTypes::CS, EmbObjSub.* FROM CQL_EmbeddedSubClass#==============================================================# Properties at the third level#==============================================================# Simple propertiesSELECT EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestElement::InstanceId FROM CQL_EmbeddedSubClassSELECT EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_ComputerSystem::EnabledState FROM CQL_EmbeddedSubClassSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyUint32Array FROM CQL_EmbeddedSubClass# Bad scoping classes# Result: instance of the FROM class is emptiedSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyString, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyUint8 FROM CQL_EmbeddedSubClass# One good scoping class, one bad scoping class# Result: project propertyStringSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyUint8 FROM CQL_EmbeddedSubClass# Combine bad scoping class, and the embedded object itself# Result: TPT is projectedSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyUint8 FROM CQL_EmbeddedSubClass# Combine one good scoping class, one bad scoping class, and the embedded object itself# Result: TPT is projectedSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyUint8, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT FROM CQL_EmbeddedSubClass#==============================================================# Wildcard at the third level, and properties at the third level.## The result of all of these is to project every property# in the tree below the third level#==============================================================  # Good scoping classSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyUint8, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.* FROM CQL_EmbeddedSubClass# Bad scoping classesSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.*, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyString, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyUint8 FROM CQL_EmbeddedSubClass# One good scoping class, one bad scoping classSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyUint8, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.* FROM CQL_EmbeddedSubClass# Combine bad scoping class, and the embedded object itselfSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.*, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyUint8 FROM CQL_EmbeddedSubClass# Combine one good scoping class, one bad scoping class, and the embedded object itselfSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.*, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyUint8, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT FROM CQL_EmbeddedSubClass#===================================================================## Mixed Level Testing## Test projection of whole embedded objects, with child properties# also projected.## If a chained identifier ends at an embedded object, then the# whole embedded object is projected, ie. whatever properties # are on that embedded object remain after the projection, regardless# of the type of the embedded object.## This set of testcases test that all the properties on the embedded# object are preserved, even if other chained identifiers call# out child properties on the embedded object.## Note that wildcard is treated as if each child embedded object# property on the wildcarded object is projected as a whole.## Example:#  # Class fc has two embedded object properties, eo1 and eo2. # eo1 is of type scopeclass, and has two properties, p1 and p2## SELECT fc.*, fc.eo1.scopeclass::p1 FROM fc# is equivalent to# SELECT fc.eo1, fc.eo2, fc.eo1.scopeclass::p1 FROM fc## e01 and e02 need to projected as-is, ie. p2 is preserved on eo1. #===================================================================# No whole embedded objects or wildcards.  Just pick two leaves to set a baseline# Projected Properties:# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString => projected# EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState  => ignored## Result: project propertyString#SELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState FROM CQL_EmbeddedSubClass# No whole embedded objects or wildcards.  Just pick two leaves to set a baseline# Projected Properties:# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyString => ignored# EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState  => ignored## Result: project nothing, instance of FROM class is emptied#SELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyString, EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState FROM CQL_EmbeddedSubClass# Wildcard the FROM class, and pick two leaves, one with good scope, one with bad scope.# Projected Properties:# *# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString => projected# EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState => ignored  ## Result: project all properties in the embedded tree below CQL_EmbeddedSubClass

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -