Skip to content

Commit

Permalink
repo-sqale: case/wi/refs review, cosmetics/typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Jun 8, 2021
1 parent 50e5d92 commit 41a69fb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
4 changes: 2 additions & 2 deletions repo/repo-sqale/sql/pgnew-repo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,8 @@ CREATE TABLE m_case_wi (
)
INHERITS(m_container);

-- TODO INDEXES, old repo had no indexes either

-- stores workItem/assigneeRef
CREATE TABLE m_case_wi_assignee (
ownerOid UUID NOT NULL REFERENCES m_object_oid(oid) ON DELETE CASCADE,
Expand All @@ -1227,8 +1229,6 @@ CREATE TABLE m_case_wi_candidate (

ALTER TABLE m_case_wi_candidate ADD CONSTRAINT m_case_wi_candidate_id_fk
FOREIGN KEY (ownerOid, workItemCid) REFERENCES m_case_wi (ownerOid, cid);

-- TODO INDEXES, old repo had no indexes either
-- endregion

-- region Access Certification object tables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@
import java.util.Objects;
import java.util.function.BiFunction;

import com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType;

import com.querydsl.core.types.Predicate;
import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.repo.sqale.SqaleRepoContext;
import com.evolveum.midpoint.repo.sqale.qmodel.assignment.*;
import com.evolveum.midpoint.repo.sqale.qmodel.object.MObject;
import com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType;
import com.evolveum.midpoint.repo.sqale.qmodel.ref.QReferenceMapping;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;

Expand All @@ -41,9 +38,7 @@ public class QCaseWorkItemReferenceMapping
return getForCaseWorkItemAssignee();
}

public static QCaseWorkItemReferenceMapping
getForCaseWorkItemAssignee() {
//noinspection unchecked
public static QCaseWorkItemReferenceMapping getForCaseWorkItemAssignee() {
return Objects.requireNonNull(instanceAssignee);
}

Expand All @@ -56,14 +51,10 @@ public class QCaseWorkItemReferenceMapping
return getForCaseWorkItemCandidate();
}

public static QCaseWorkItemReferenceMapping
getForCaseWorkItemCandidate() {
//noinspection unchecked
public static QCaseWorkItemReferenceMapping getForCaseWorkItemCandidate() {
return Objects.requireNonNull(instanceCandidate);
}



private QCaseWorkItemReferenceMapping(
String tableName,
String defaultAliasName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ public void initObjects() throws Exception {
new ShadowType(prismContext).name("shadow-1").asPrismObject(),
null, result);
service1Oid = repositoryService.addObject(
new ServiceType(prismContext).name("service-1").asPrismObject(),
new ServiceType(prismContext).name("service-1")
// TODO integer attribute
.asPrismObject(),
null, result);
case1Oid = repositoryService.addObject(
new CaseType(prismContext).name("case-1")
Expand Down Expand Up @@ -503,12 +505,12 @@ public void test182SearchCaseWorkItemByAssignee() throws Exception {
searchCaseWorkItemByAssignee(NONEXIST_OID, null);
}

private void searchCaseWorkItemByAssignee(String asigneeOid, String expectedCaseOid) throws Exception {
when("searching case with query for workitem/assigneeRef OID " + asigneeOid);
private void searchCaseWorkItemByAssignee(String assigneeOid, String expectedCaseOid) throws Exception {
when("searching case with query for workitem/assigneeRef OID " + assigneeOid);
OperationResult operationResult = createOperationResult();
SearchResultList<CaseType> result = searchObjects(CaseType.class,
prismContext.queryFor(CaseType.class)
.item(CaseType.F_WORK_ITEM, CaseWorkItemType.F_ASSIGNEE_REF).ref(asigneeOid)
.item(CaseType.F_WORK_ITEM, CaseWorkItemType.F_ASSIGNEE_REF).ref(assigneeOid)
.build(),
operationResult);

Expand Down

0 comments on commit 41a69fb

Please sign in to comment.