Skip to content

Commit

Permalink
repo-sqale: update of querydsl mapping around QOrgClosure
Browse files Browse the repository at this point in the history
Still no Q*Mapping class is needed, this is only for query support.
  • Loading branch information
virgo47 committed May 12, 2021
1 parent 81fb76f commit cca4cb8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
Expand Up @@ -7,10 +7,9 @@
package com.evolveum.midpoint.repo.sqale.qmodel.org;

import com.evolveum.midpoint.repo.sqale.qmodel.role.MAbstractRole;
import com.evolveum.midpoint.repo.sqale.qmodel.role.QRole;

/**
* Querydsl "row bean" type related to {@link QRole}.
* Querydsl "row bean" type related to {@link QOrg}.
*/
public class MOrg extends MAbstractRole {

Expand Down
@@ -0,0 +1,23 @@
/*
* 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.
*/
package com.evolveum.midpoint.repo.sqale.qmodel.org;

import java.util.UUID;

/**
* Querydsl "row bean" type related to {@link QOrgClosure}.
*/
public class MOrgClosure {

public UUID ancestorOid;
public UUID descendantOid;

@Override
public String toString() {
return "MOrgClosure{" + ancestorOid + " -> " + descendantOid + '}';
}
}
Expand Up @@ -12,24 +12,26 @@
import com.evolveum.midpoint.repo.sqlbase.querydsl.UuidPath;

/**
* Querydsl query type for common table expression (CTE) representing org hierarchy on the fly.
* Does not use any backing bean, it is never retrieved directly, only used in the query.
* Querydsl query type for org closure table.
* Can also be used for common table expression (CTE) representing org hierarchy on the fly.
* This does not have to be under {@link FlexibleRelationalPathBase}, but is for convenience.
*/
@SuppressWarnings("unused")
public class QOrgClosure extends FlexibleRelationalPathBase<QOrgClosure> {
public class QOrgClosure extends FlexibleRelationalPathBase<MOrgClosure> {

private static final long serialVersionUID = 4406075586720866032L;

public static final String TABLE_NAME = "m_org_closure";

public static final String DEFAULT_ALIAS_NAME = "orgc";

public static final ColumnMetadata PARENT =
ColumnMetadata.named("parent").ofType(UuidPath.UUID_TYPE);
public static final ColumnMetadata CHILD =
ColumnMetadata.named("child").ofType(UuidPath.UUID_TYPE);
public static final ColumnMetadata ANCESTOR_OID =
ColumnMetadata.named("ancestor_oid").ofType(UuidPath.UUID_TYPE);
public static final ColumnMetadata DESCENDANT_OID =
ColumnMetadata.named("descendant_oid").ofType(UuidPath.UUID_TYPE);

public final UuidPath parent = createUuid("parent", PARENT);
public final UuidPath child = createUuid("child", CHILD);
public final UuidPath ancestorOid = createUuid("ancestorOid", ANCESTOR_OID);
public final UuidPath descendantOid = createUuid("descendantOid", DESCENDANT_OID);

public QOrgClosure() {
this(DEFAULT_ALIAS_NAME, DEFAULT_SCHEMA_NAME);
Expand All @@ -40,6 +42,6 @@ public QOrgClosure(String variable) {
}

public QOrgClosure(String variable, String schema) {
super(QOrgClosure.class, variable, schema, "orgc"); // not a real table
super(MOrgClosure.class, variable, schema, TABLE_NAME);
}
}

0 comments on commit cca4cb8

Please sign in to comment.