Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
206 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
repo/repo-sqale/src/main/java/com/evolveum/midpoint/repo/sqale/qbean/MUser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.qbean; | ||
|
||
import com.evolveum.midpoint.repo.sqale.qmodel.QUser; | ||
|
||
/** | ||
* Querydsl "row bean" type related to {@link QUser}. | ||
*/ | ||
public class MUser extends MObject { | ||
|
||
public String additionalNameNorm; | ||
public String additionalNameOrig; | ||
public String employeeNumber; | ||
public String familyNameNorm; | ||
public String familyNameOrig; | ||
public String fullNameNorm; | ||
public String fullNameOrig; | ||
public String givenNameNorm; | ||
public String givenNameOrig; | ||
public String honorificPrefixNorm; | ||
public String honorificPrefixOrig; | ||
public String honorificSuffixNorm; | ||
public String honorificSuffixOrig; | ||
public String nickNameNorm; | ||
public String nickNameOrig; | ||
public String titleNorm; | ||
public String titleOrig; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
repo/repo-sqale/src/main/java/com/evolveum/midpoint/repo/sqale/qmapping/QUserMapping.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* 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.qmapping; | ||
|
||
import static com.evolveum.midpoint.xml.ns._public.common.common_3.UserType.*; | ||
|
||
import com.evolveum.midpoint.repo.sqale.qbean.MUser; | ||
import com.evolveum.midpoint.repo.sqale.qmodel.QUser; | ||
import com.evolveum.midpoint.repo.sqlbase.SqlRepoContext; | ||
import com.evolveum.midpoint.repo.sqlbase.SqlTransformerContext; | ||
import com.evolveum.midpoint.repo.sqlbase.mapping.item.PolyStringItemFilterProcessor; | ||
import com.evolveum.midpoint.repo.sqlbase.mapping.item.StringItemFilterProcessor; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; | ||
|
||
/** | ||
* Mapping between {@link QUser} and {@link UserType}. | ||
*/ | ||
public class QUserMapping | ||
extends QObjectMapping<UserType, QUser, MUser> { | ||
|
||
public static final String DEFAULT_ALIAS_NAME = "u"; | ||
|
||
public static final QUserMapping INSTANCE = new QUserMapping(); | ||
|
||
private QUserMapping() { | ||
super(QUser.TABLE_NAME, DEFAULT_ALIAS_NAME, | ||
UserType.class, QUser.class); | ||
|
||
addItemMapping(F_ADDITIONAL_NAME, | ||
PolyStringItemFilterProcessor.mapper( | ||
path(q -> q.additionalNameOrig), path(q -> q.additionalNameNorm))); | ||
addItemMapping(F_EMPLOYEE_NUMBER, | ||
StringItemFilterProcessor.mapper(path(q -> q.employeeNumber))); | ||
addItemMapping(F_FAMILY_NAME, | ||
PolyStringItemFilterProcessor.mapper( | ||
path(q -> q.familyNameOrig), path(q -> q.familyNameNorm))); | ||
addItemMapping(F_FULL_NAME, | ||
PolyStringItemFilterProcessor.mapper( | ||
path(q -> q.fullNameOrig), path(q -> q.fullNameNorm))); | ||
addItemMapping(F_GIVEN_NAME, | ||
PolyStringItemFilterProcessor.mapper( | ||
path(q -> q.givenNameOrig), path(q -> q.givenNameNorm))); | ||
addItemMapping(F_HONORIFIC_PREFIX, | ||
PolyStringItemFilterProcessor.mapper( | ||
path(q -> q.honorificPrefixOrig), path(q -> q.honorificPrefixNorm))); | ||
addItemMapping(F_HONORIFIC_SUFFIX, | ||
PolyStringItemFilterProcessor.mapper( | ||
path(q -> q.honorificSuffixOrig), path(q -> q.honorificSuffixNorm))); | ||
addItemMapping(F_NICK_NAME, | ||
PolyStringItemFilterProcessor.mapper( | ||
path(q -> q.nickNameOrig), path(q -> q.nickNameNorm))); | ||
addItemMapping(F_TITLE, | ||
PolyStringItemFilterProcessor.mapper( | ||
path(q -> q.titleOrig), path(q -> q.titleNorm))); | ||
} | ||
|
||
@Override | ||
protected QUser newAliasInstance(String alias) { | ||
return new QUser(alias); | ||
} | ||
|
||
@Override | ||
public ObjectSqlTransformer<UserType, QUser, MUser> | ||
createTransformer(SqlTransformerContext transformerContext, SqlRepoContext sqlRepoContext) { | ||
// no special class needed, no additional columns | ||
return new ObjectSqlTransformer<>(transformerContext, this); | ||
} | ||
|
||
@Override | ||
public MUser newRowObject() { | ||
return new MUser(); | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
repo/repo-sqale/src/main/java/com/evolveum/midpoint/repo/sqale/qmodel/QUser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* 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; | ||
|
||
import java.sql.Types; | ||
|
||
import com.querydsl.core.types.dsl.StringPath; | ||
import com.querydsl.sql.ColumnMetadata; | ||
import com.querydsl.sql.PrimaryKey; | ||
|
||
import com.evolveum.midpoint.repo.sqale.qbean.MUser; | ||
|
||
/** | ||
* Querydsl query type for {@value #TABLE_NAME} table. | ||
*/ | ||
@SuppressWarnings("unused") | ||
public class QUser extends QObject<MUser> { | ||
|
||
private static final long serialVersionUID = -6556210963622526756L; | ||
|
||
public static final String TABLE_NAME = "m_user"; | ||
|
||
public static final ColumnMetadata User_TYPE = | ||
ColumnMetadata.named("UserType").ofType(Types.VARCHAR).withSize(255); | ||
|
||
public static final ColumnMetadata ADDITIONAL_NAME_NORM = | ||
ColumnMetadata.named("additionalName_norm").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata ADDITIONAL_NAME_ORIG = | ||
ColumnMetadata.named("additionalName_orig").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata EMPLOYEE_NUMBER = | ||
ColumnMetadata.named("employeeNumber").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata FAMILY_NAME_NORM = | ||
ColumnMetadata.named("familyName_norm").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata FAMILY_NAME_ORIG = | ||
ColumnMetadata.named("familyName_orig").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata FULL_NAME_NORM = | ||
ColumnMetadata.named("fullName_norm").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata FULL_NAME_ORIG = | ||
ColumnMetadata.named("fullName_orig").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata GIVEN_NAME_NORM = | ||
ColumnMetadata.named("givenName_norm").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata GIVEN_NAME_ORIG = | ||
ColumnMetadata.named("givenName_orig").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata HONORIFIC_PREFIX_NORM = | ||
ColumnMetadata.named("honorificPrefix_norm").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata HONORIFIC_PREFIX_ORIG = | ||
ColumnMetadata.named("honorificPrefix_orig").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata HONORIFIC_SUFFIX_NORM = | ||
ColumnMetadata.named("honorificSuffix_norm").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata HONORIFIC_SUFFIX_ORIG = | ||
ColumnMetadata.named("honorificSuffix_orig").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata NICK_NAME_NORM = | ||
ColumnMetadata.named("nickName_norm").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata NICK_NAME_ORIG = | ||
ColumnMetadata.named("nickName_orig").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata TITLE_NORM = | ||
ColumnMetadata.named("title_norm").ofType(Types.VARCHAR).withSize(255); | ||
public static final ColumnMetadata TITLE_ORIG = | ||
ColumnMetadata.named("title_orig").ofType(Types.VARCHAR).withSize(255); | ||
|
||
public final StringPath additionalNameNorm = createString("additionalNameNorm", ADDITIONAL_NAME_NORM); | ||
public final StringPath additionalNameOrig = createString("additionalNameOrig", ADDITIONAL_NAME_ORIG); | ||
public final StringPath employeeNumber = createString("employeeNumber", EMPLOYEE_NUMBER); | ||
public final StringPath familyNameNorm = createString("familyNameNorm", FAMILY_NAME_NORM); | ||
public final StringPath familyNameOrig = createString("familyNameOrig", FAMILY_NAME_ORIG); | ||
public final StringPath fullNameNorm = createString("fullNameNorm", FULL_NAME_NORM); | ||
public final StringPath fullNameOrig = createString("fullNameOrig", FULL_NAME_ORIG); | ||
public final StringPath givenNameNorm = createString("givenNameNorm", GIVEN_NAME_NORM); | ||
public final StringPath givenNameOrig = createString("givenNameOrig", GIVEN_NAME_ORIG); | ||
public final StringPath honorificPrefixNorm = createString("honorificPrefixNorm", HONORIFIC_PREFIX_NORM); | ||
public final StringPath honorificPrefixOrig = createString("honorificPrefixOrig", HONORIFIC_PREFIX_ORIG); | ||
public final StringPath honorificSuffixNorm = createString("honorificSuffixNorm", HONORIFIC_SUFFIX_NORM); | ||
public final StringPath honorificSuffixOrig = createString("honorificSuffixOrig", HONORIFIC_SUFFIX_ORIG); | ||
public final StringPath nickNameNorm = createString("nickNameNorm", NICK_NAME_NORM); | ||
public final StringPath nickNameOrig = createString("nickNameOrig", NICK_NAME_ORIG); | ||
public final StringPath titleNorm = createString("titleNorm", TITLE_NORM); | ||
public final StringPath titleOrig = createString("titleOrig", TITLE_ORIG); | ||
|
||
public final PrimaryKey<MUser> pk = createPrimaryKey(oid); | ||
|
||
public QUser(String variable) { | ||
this(variable, DEFAULT_SCHEMA_NAME, TABLE_NAME); | ||
} | ||
|
||
public QUser(String variable, String schema, String table) { | ||
super(MUser.class, variable, schema, table); | ||
} | ||
} |