Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Feb 9, 2021
2 parents 1c05b85 + 5b0e58d commit e309536
Show file tree
Hide file tree
Showing 18 changed files with 379 additions and 259 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2020 Evolveum and contributors
* Copyright (C) 2010-2021 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -54,12 +54,12 @@
import com.evolveum.midpoint.prism.xml.XmlTypeConverter;
import com.evolveum.midpoint.repo.sql.data.common.any.RExtItem;
import com.evolveum.midpoint.repo.sql.query.QueryEngine;
import com.evolveum.midpoint.repo.sqlbase.QueryException;
import com.evolveum.midpoint.repo.sql.query.RQuery;
import com.evolveum.midpoint.repo.sql.query.RQueryImpl;
import com.evolveum.midpoint.repo.sql.query.hqm.RootHibernateQuery;
import com.evolveum.midpoint.repo.sql.type.XMLGregorianCalendarType;
import com.evolveum.midpoint.repo.sql.util.RUtil;
import com.evolveum.midpoint.repo.sqlbase.QueryException;
import com.evolveum.midpoint.schema.GetOperationOptions;
import com.evolveum.midpoint.schema.SearchResultList;
import com.evolveum.midpoint.schema.SelectorOptions;
Expand Down Expand Up @@ -2325,7 +2325,7 @@ private void checkQueryTypeAlias(String query, String table, String... propertie
}

@Test
public void test162QueryObjectypeByTypeOrgAndLocality() throws Exception {
public void test162QueryObjectTypeByTypeOrgAndLocality() throws Exception {
Session session = open();
try {
ObjectQuery query = prismContext.queryFor(ObjectType.class)
Expand Down Expand Up @@ -2353,7 +2353,7 @@ public void test162QueryObjectypeByTypeOrgAndLocality() throws Exception {
}

@Test
public void test164QueryObjectypeByTypeAndExtensionAttribute() throws Exception {
public void test164QueryObjectTypeByTypeAndExtensionAttribute() throws Exception {
Session session = open();
try {
ObjectQuery query = prismContext.queryFor(ObjectType.class)
Expand Down Expand Up @@ -2381,7 +2381,7 @@ public void test164QueryObjectypeByTypeAndExtensionAttribute() throws Exception
}

@Test
public void test166QueryObjectypeByTypeAndReference() throws Exception {
public void test166QueryObjectTypeByTypeAndReference() throws Exception {
Session session = open();
try {
ObjectQuery query = prismContext.queryFor(ObjectType.class)
Expand Down Expand Up @@ -2410,7 +2410,7 @@ public void test166QueryObjectypeByTypeAndReference() throws Exception {
}

@Test
public void test170QueryObjectypeByTypeComplex() throws Exception {
public void test170QueryObjectTypeByTypeComplex() throws Exception {
Session session = open();
try {
ObjectQuery query = prismContext.queryFor(ObjectType.class)
Expand Down Expand Up @@ -2458,7 +2458,7 @@ public void test170QueryObjectypeByTypeComplex() throws Exception {
}

@Test
public void test171QueryObjectypeByTwoAbstractTypes() throws Exception {
public void test171QueryObjectTypeByTwoAbstractTypes() throws Exception {
Session session = open();
try {
ObjectQuery query = prismContext.queryFor(ObjectType.class)
Expand Down Expand Up @@ -3177,6 +3177,40 @@ public void test302QueryWorkItemsForCampaign() throws Exception {
}
}

// TODO WIP MID-6799 what columns to load?
@Test
public void test320AssignmentQuery() throws Exception {
Session session = open();
try {
ObjectQuery query = prismContext.queryFor(AssignmentType.class)
.ownerId("1", "2").build();

String real = getInterpretedQuery(session, AssignmentType.class, query, false);
assertThat(real).isEqualToIgnoringWhitespace("select\n"
+ " a.ownerOid,\n"
+ " a.id,\n"
+ " a.order,\n"
+ " a.lifecycleState,\n"
+ " a.activation,\n"
+ " a.targetRef,\n"
+ " a.tenantRef,\n"
+ " a.orgRef,\n"
+ " a.resourceRef,\n"
+ " a.createTimestamp,\n"
+ " a.creatorRef,\n"
+ " a.createChannel,\n"
+ " a.modifyTimestamp,\n"
+ " a.modifierRef,\n"
+ " a.modifyChannel\n"
+ "from\n"
+ " RAssignment a\n"
+ "where\n"
+ " a.ownerOid in (:ownerOid)");
} finally {
close(session);
}
}

@Test
public void test400DereferenceLink() throws Exception {
Session session = open();
Expand Down

0 comments on commit e309536

Please sign in to comment.