N°1213 - Allow NOT IN SELECT in OQL syntax

This commit is contained in:
Eric
2019-12-03 09:07:54 +01:00
parent 7845cbcc55
commit c0ae983faa
9 changed files with 467 additions and 466 deletions

View File

@@ -188,25 +188,40 @@ class ScalarOqlExpression extends ScalarExpression implements CheckableExpressio
}
}
class NestedQueryOqlExpression extends NestedQueryExpression implements CheckableExpression{
class NestedQueryOqlExpression extends NestedQueryExpression implements CheckableExpression
{
/** @var OQLObjectQuery */
private $m_oOQLObjectQuery;
/*Here $m_oNestedQuery is an OQLObjectQuery*/
public function __construct($oNestedQuery)
/**
* NestedQueryOqlExpression constructor.
*
* @param OQLObjectQuery $oOQLObjectQuery
*/
public function __construct($oOQLObjectQuery )
{
//OQLObjectQuery
$this->m_oNestedQuery = $oNestedQuery;
$this->m_sQuery="";
parent::__construct(null);
$this->m_oOQLObjectQuery = $oOQLObjectQuery;
}
/**
* Recursively check the validity of the expression with regard to the data model
* and the query in which it is used
*
* @param ModelReflection $oModelReflection MetaModel to consider
* @throws OqlNormalizeException
* @param array $aAliases
* @param string $sSourceQuery
*
* @throws \OqlNormalizeException
*/
public function Check(ModelReflection $oModelReflection, $aAliases, $sSourceQuery)
{
$this->m_oNestedQuery-> Check($oModelReflection, "", $aAliases);
$this->m_oOQLObjectQuery->Check($oModelReflection, "", $aAliases);
}
public function GetOQLObjectQuery()
{
return $this->m_oOQLObjectQuery;
}
}
@@ -589,6 +604,7 @@ class OqlUnionQuery extends OqlQuery
public function __construct(OqlObjectQuery $oLeftQuery, OqlQuery $oRightQueryOrUnion)
{
parent::__construct();
$this->aQueries[] = $oLeftQuery;
if ($oRightQueryOrUnion instanceof OqlUnionQuery)
{
@@ -659,6 +675,7 @@ class OqlUnionQuery extends OqlQuery
}
foreach ($aColumnToClasses as $iColumn => $aClasses)
{
$sRootClass = null;
foreach ($aClasses as $iQuery => $aData)
{
if ($iQuery == 0)
@@ -731,10 +748,6 @@ class OqlUnionQuery extends OqlQuery
// first loop
$sAncestor = $sClass;
}
elseif ($sClass == $sAncestor)
{
// remains the same
}
elseif ($oModelReflection->GetRootClass($sClass) != $oModelReflection->GetRootClass($sAncestor))
{
$sAncestor = null;
@@ -786,4 +799,4 @@ class OqlUnionQuery extends OqlQuery
$oSearch = new DBUnionSearch($aSearches);
return $oSearch;
}
}
}