📄 embeddedselect.query
字号:
#SELECT *, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState FROM CQL_EmbeddedSubClass# Wildcard the FROM class, and pick two leaves, one with good scope but missing property, one with bad scope.# Projected Properties:# *# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::NotThere => missing# EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState => ignored ## Result: Error#SELECT *, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::NotThere, EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState FROM CQL_EmbeddedSubClass# Nested wildcards, and pick two leaves, one with good scope, one with bad scope.# Projected Properties:# *# EmbObjBase.*# EmbObjSub.*# 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#SELECT *, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState, EmbObjBase.*, EmbObjSub.* FROM CQL_EmbeddedSubClass# Wildcard the FROM class, nested whole embedded objects,# and pick two leaves, one with good scope, one with bad scope.# Projected Properties:# *# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT# EmbObjBase.CQL_EmbeddedTestElement::CS# 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#SELECT *, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT, EmbObjBase.CQL_EmbeddedTestElement::CS FROM CQL_EmbeddedSubClass # Wildcard the first level embedded object,# and pick two leaves, one with good scope, one with bad scope.# Projected Properties:# EmbObjSub.*# 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 EmbObjSub#SELECT EmbObjSub.*, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState FROM CQL_EmbeddedSubClass# Wildcard the second level embedded object,# and pick two leaves, one with good scope, one with bad scope.# Projected Properties:# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.*# 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 TPT#SELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.*, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_NonExistent::propertyString, EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState FROM CQL_EmbeddedSubClass# Whole embedded objects# Projected Properties:# EmbObjSub# EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT## Result: project all properties in the embedded tree below EmbObjSub#SELECT EmbObjSub, EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT FROM CQL_EmbeddedSubClass# Whole embedded objects# and pick two leaves, one with good scope, one with bad scope.# Projected Properties:# EmbObjSub# EmbObjBase# EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8# 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 EmbObjSub and EmbObjBase#SELECT EmbObjSub, EmbObjBase, EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjBase.CQL_EmbeddedTestElement::CS.CQL_NonExistent::EnabledState FROM CQL_EmbeddedSubClass# Projected Properties:# EmbObjBase# EmbObjBase.CQL_EmbeddedTestElement::NotThere #SELECT EmbObjBase, EmbObjBase.CQL_EmbeddedTestElement::NotThere FROM CQL_EmbeddedSubClass## This tests property overlap, scoping rules are met, but property is missing# Projected Properties:# EmbObjBase# EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestElement::NotThere #SELECT EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestElement::NotThere, EmbObjBase FROM CQL_EmbeddedSubClass# Whole embedded objects, but missing property# Projected Properties:# EmbObjSub# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::NotThere## Result: Error#SELECT EmbObjSub, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::NotThere FROM CQL_EmbeddedSubClass#===================================================================# General mixed level tests# These tests pick properties at different levels in the tree#===================================================================## Test the scoping operator# See '==>' below for details about which properties are projected, and which are not.# Note: this also tests the case where leaves are selected from different branches of the tree.# Projected Properties:# EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8 => scope matches, project# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestElement::InstanceId => scope is superclass, project# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString => scope matches, project# EmbObjBase.CQL_EmbeddedTestElement::SomeString => scope matches, project# EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestPropertyTypes::InstanceId => scope is subclass, ignore # EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_NonExistent::EnabledState => scope doesn't exist, ignore# EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_Process::Description => scope is unrelated, ignore #SELECT EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestPropertyTypes::InstanceId, EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8, EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_Process::Description, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestElement::InstanceId, EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_NonExistent::EnabledState, EmbObjBase.CQL_EmbeddedTestElement::SomeString FROM CQL_EmbeddedSubClass## Projected Properties:# EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.*# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyUint32Array# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString# EmbObjBase.CQL_EmbeddedTestElement::SomeString # EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestElement::InstanceId # EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_ComputerSystem::EnabledState # EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_ComputerSystem::Description #SELECT EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_ComputerSystem::EnabledState, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.*, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjBase.CQL_EmbeddedTestElement::SomeString, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyUint32Array, EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestElement::InstanceId, EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8, EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_ComputerSystem::Description FROM CQL_EmbeddedSubClass#===================================================================# Runtime errors#===================================================================# Missing required property.# The NotThere property is missing in this case. Even though the property is not on its scoping# class, it is still missing with respect to the instance being projected. Properties# missing with respect to the class definition are checked by validateProperties, not applyProjection.# # Projected Properties:# EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8 => scope matches, project# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestElement::InstanceId => scope is superclass, project# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::NotThere => property is missing # EmbObjBase.CQL_EmbeddedTestElement::SomeString => scope matches, project# EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestPropertyTypes::InstanceId => scope is subclass, ignore # EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_NonExistent::EnabledState => scope doesn't exist, ignore# EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_Process::Description => scope is unrelated, ignore SELECT EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestPropertyTypes::InstanceId, EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8, EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_Process::Description, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::NotThere, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestElement::InstanceId, EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_NonExistent::EnabledState, EmbObjBase.CQL_EmbeddedTestElement::SomeString FROM CQL_EmbeddedSubClass# Missing required property.# The NotThere property is missing in this case. Even though the property is not on its scoping# class, it is still missing with respect to the instance being projected. Properties# missing with respect to the class definition are checked by validateProperties, not applyProjection.# Note that in this case the missing property is in the middle of a chain.# # Projected Properties:# EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8 => scope matches, project# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestElement::InstanceId => scope is superclass, project# EmbObjSub.CQL_EmbeddedTestPropertyTypes::NotThere.CQL_TestPropertyTypes::InstanceId => property is missing # EmbObjBase.CQL_EmbeddedTestElement::SomeString => scope matches, project# EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestPropertyTypes::InstanceId => scope is subclass, ignore # EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_NonExistent::EnabledState => scope doesn't exist, ignore# EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_Process::Description => scope is unrelated, ignore SELECT EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestPropertyTypes::InstanceId, EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8, EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_Process::Description, EmbObjSub.CQL_EmbeddedTestPropertyTypes::NotThere.CQL_TestPropertyTypes::InstanceId, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestElement::InstanceId, EmbObjBase.CQL_EmbeddedTestElement::CS.CIM_NonExistent::EnabledState, EmbObjBase.CQL_EmbeddedTestElement::SomeString FROM CQL_EmbeddedSubClass# Missing required property, wildcard case.# Note: this assumes that CQLCLI removes the PrimaryOwnerName property from the CS instance# # Projected Properties:# EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8 => scope matches, project# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestElement::InstanceId => scope is superclass, project# EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString => scope matches, project # EmbObjBase.CQL_EmbeddedTestElement::SomeString => scope matches, project# EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestPropertyTypes::InstanceId => scope is subclass, ignore # EmbObjBase.CQL_EmbeddedTestElement::CS.* => wildcard causes missing propertiesSELECT EmbObjBase.CQL_EmbeddedTestElement::TE.CQL_TestPropertyTypes::InstanceId, EmbObjSub.CQL_EmbeddedTestPropertyTypes::SomeUint8, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestPropertyTypes::propertyString, EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPT.CQL_TestElement::InstanceId, EmbObjBase.CQL_EmbeddedTestElement::CS.*, EmbObjBase.CQL_EmbeddedTestElement::SomeString FROM CQL_EmbeddedSubClass#===================================================================# Illegal statements#===================================================================# The FROM class needs properties specifiedSELECT CQL_EmbeddedSubClass FROM CQL_EmbeddedSubClass # Not allowed to project array elementsSELECT EmbObjBase.CQL_EmbeddedTestElement::TEArray[2] FROM CQL_EmbeddedSubClassSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPTArray[2] FROM CQL_EmbeddedSubClassSELECT EmbObjBase.CQL_EmbeddedTestElement::TEArray[1].* FROM CQL_EmbeddedSubClassSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPTArray[1].* FROM CQL_EmbeddedSubClassSELECT EmbObjBase.CQL_EmbeddedTestElement::TEArray[0].CQL_TestElement::InstanceId FROM CQL_EmbeddedSubClassSELECT EmbObjSub.CQL_EmbeddedTestPropertyTypes::TPTArray[0].CQL_TestPropertyTypes::propertyDatetimeArray FROM CQL_EmbeddedSubClass# Not well formed, TEArray is an arraySELECT EmbObjBase.CQL_EmbeddedTestElement::TEArray.* FROM CQL_EmbeddedSubClassSELECT EmbObjBase.CQL_EmbeddedTestElement::TEArray.CQL_TestElement::InstanceId FROM CQL_EmbeddedSubClass# Not allowed to project properties on classesSELECT EmbObjBase.CQL_EmbeddedTestElement::SomeClass.CIM_Process::RequestedState FROM CQL_EmbeddedSubClassSELECT EmbObjBase.CQL_EmbeddedTestElement::SomeClass.* FROM CQL_EmbeddedSubClass# SomeString is not an embedded objectSELECT EmbObjBase.CQL_EmbeddedTestElement::SomeString.CQL_TestElement::InstanceId FROM CQL_EmbeddedSubClassSELECT EmbObjBase.CQL_EmbeddedTestElement::SomeString.* FROM CQL_EmbeddedSubClass# Missing scoping operatorSELECT EmbObjBase.SomeString FROM CQL_EmbeddedSubClass
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -