SEARCH-433 CMIS QL - Support inner and left outer joins from/to a single type and any number of aspects

- fix switch style issues
This commit is contained in:
ahind
2017-10-20 12:29:04 +01:00
parent 82854e2d68
commit 8a6ec6604b
2 changed files with 53 additions and 53 deletions

View File

@@ -107,6 +107,13 @@ public class AspectSupport implements DBQueryBuilderComponent
DBQueryBuilderPredicatePartCommand command;
switch(joinType)
{
case LEFT:
case RIGHT:
command = new DBQueryBuilderPredicatePartCommand();
command.setJoinCommandType(DBQueryBuilderJoinCommandType.ASPECT);
command.setType(DBQueryBuilderPredicatePartCommandType.NP_MATCHES);
predicatePartCommands.add(command);
break;
case NONE:
case INNER:
default:
@@ -124,13 +131,6 @@ public class AspectSupport implements DBQueryBuilderComponent
}
predicatePartCommands.add(command);
break;
case LEFT:
case RIGHT:
command = new DBQueryBuilderPredicatePartCommand();
command.setJoinCommandType(DBQueryBuilderJoinCommandType.ASPECT);
command.setType(DBQueryBuilderPredicatePartCommandType.NP_MATCHES);
predicatePartCommands.add(command);
break;
}
}

View File

@@ -1,28 +1,28 @@
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
* the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license terms:
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.repo.search.impl.querymodel.impl.db;
import java.util.ArrayList;
@@ -33,8 +33,8 @@ import java.util.Set;
import org.alfresco.repo.domain.node.NodeDAO;
import org.alfresco.repo.domain.qname.QNameDAO;
import org.alfresco.repo.search.impl.querymodel.Argument;
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
import org.alfresco.repo.search.impl.querymodel.JoinType;
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext;
import org.alfresco.repo.search.impl.querymodel.JoinType;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.namespace.NamespaceService;
@@ -111,12 +111,19 @@ public class TypeSupport implements DBQueryBuilderComponent
*/
@Override
public void buildPredicateCommands(List<DBQueryBuilderPredicatePartCommand> predicatePartCommands)
{
DBQueryBuilderPredicatePartCommand command;
switch(joinType)
{
case NONE:
case INNER:
{
DBQueryBuilderPredicatePartCommand command;
switch(joinType)
{
case LEFT:
case RIGHT:
command = new DBQueryBuilderPredicatePartCommand();
command.setJoinCommandType(DBQueryBuilderJoinCommandType.NODE);
command.setType(DBQueryBuilderPredicatePartCommandType.NP_MATCHES);
predicatePartCommands.add(command);
break;
case NONE:
case INNER:
default:
command = new DBQueryBuilderPredicatePartCommand();
command.setJoinCommandType(DBQueryBuilderJoinCommandType.NODE);
@@ -131,22 +138,15 @@ public class TypeSupport implements DBQueryBuilderComponent
{
command.setValues(new Long[]{-1l});
}
predicatePartCommands.add(command);
break;
case LEFT:
case RIGHT:
command = new DBQueryBuilderPredicatePartCommand();
command.setJoinCommandType(DBQueryBuilderJoinCommandType.NODE);
command.setType(DBQueryBuilderPredicatePartCommandType.NP_MATCHES);
predicatePartCommands.add(command);
break;
predicatePartCommands.add(command);
break;
}
}
public void setJoinType(JoinType joinType)
{
this.joinType = joinType;
public void setJoinType(JoinType joinType)
{
this.joinType = joinType;
}
}