Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feature/thread-safe…
…ty-immutables
- Loading branch information
Showing
18 changed files
with
199 additions
and
65 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
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
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
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
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
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
21 changes: 21 additions & 0 deletions
21
repo/repo-sqale/src/main/java/com/evolveum/midpoint/repo/sqale/qmodel/object/MTrigger.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,21 @@ | ||
/* | ||
* 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.object; | ||
|
||
import java.time.Instant; | ||
import java.util.UUID; | ||
|
||
/** | ||
* Querydsl "row bean" type related to {@link QTrigger}. | ||
*/ | ||
public class MTrigger { | ||
|
||
public UUID ownerOid; | ||
public Integer cid; | ||
public Integer handlerUriId; | ||
public Instant timestampValue; | ||
} |
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
56 changes: 56 additions & 0 deletions
56
repo/repo-sqale/src/main/java/com/evolveum/midpoint/repo/sqale/qmodel/object/QTrigger.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,56 @@ | ||
/* | ||
* 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.object; | ||
|
||
import java.sql.Types; | ||
import java.time.Instant; | ||
|
||
import com.querydsl.core.types.dsl.DateTimePath; | ||
import com.querydsl.core.types.dsl.NumberPath; | ||
import com.querydsl.sql.ColumnMetadata; | ||
import com.querydsl.sql.PrimaryKey; | ||
|
||
import com.evolveum.midpoint.repo.sqlbase.querydsl.FlexibleRelationalPathBase; | ||
import com.evolveum.midpoint.repo.sqlbase.querydsl.UuidPath; | ||
|
||
/** | ||
* Querydsl query type for {@value #TABLE_NAME} table. | ||
*/ | ||
@SuppressWarnings("unused") | ||
public class QTrigger extends FlexibleRelationalPathBase<MTrigger> { | ||
|
||
private static final long serialVersionUID = 2478404102829142213L; | ||
|
||
public static final String TABLE_NAME = "m_trigger"; | ||
|
||
public static final ColumnMetadata OWNER_OID = | ||
ColumnMetadata.named("owner_oid").ofType(UuidPath.UUID_TYPE); | ||
public static final ColumnMetadata CID = | ||
ColumnMetadata.named("cid").ofType(Types.INTEGER); | ||
public static final ColumnMetadata HANDLER_URI_ID = | ||
ColumnMetadata.named("handlerUri_id").ofType(Types.INTEGER); | ||
public static final ColumnMetadata TIMESTAMP_VALUE = | ||
ColumnMetadata.named("timestampValue").ofType(Types.TIMESTAMP_WITH_TIMEZONE); | ||
|
||
// attributes | ||
|
||
public final UuidPath ownerOid = createUuid("ownerOid", OWNER_OID); | ||
public final NumberPath<Integer> cid = createInteger("cid", CID); | ||
public final NumberPath<Integer> handlerUriId = createInteger("handlerUriId", HANDLER_URI_ID); | ||
public final DateTimePath<Instant> timestampValue = | ||
createInstant("timestampValue", TIMESTAMP_VALUE); | ||
|
||
public final PrimaryKey<MTrigger> id = createPrimaryKey(ownerOid, cid); | ||
|
||
public QTrigger(String variable) { | ||
this(variable, DEFAULT_SCHEMA_NAME, TABLE_NAME); | ||
} | ||
|
||
public QTrigger(String variable, String schema, String table) { | ||
super(MTrigger.class, variable, schema, table); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...o-sqale/src/main/java/com/evolveum/midpoint/repo/sqale/qmodel/object/QTriggerMapping.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,50 @@ | ||
/* | ||
* 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.object; | ||
|
||
import com.evolveum.midpoint.repo.sqale.UriItemFilterProcessor; | ||
import com.evolveum.midpoint.repo.sqale.qmodel.SqaleModelMapping; | ||
import com.evolveum.midpoint.repo.sqlbase.mapping.item.TimestampItemFilterProcessor; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.TriggerType; | ||
|
||
/** | ||
* Mapping between {@link QTrigger} and {@link TriggerType}. | ||
*/ | ||
public class QTriggerMapping | ||
extends SqaleModelMapping<TriggerType, QTrigger, MTrigger> { | ||
|
||
public static final String DEFAULT_ALIAS_NAME = "trg"; | ||
|
||
public static final QTriggerMapping INSTANCE = new QTriggerMapping(); | ||
|
||
private QTriggerMapping() { | ||
super(QTrigger.TABLE_NAME, DEFAULT_ALIAS_NAME, | ||
TriggerType.class, QTrigger.class); | ||
|
||
// TODO (how) is CID queried? | ||
addItemMapping(TriggerType.F_HANDLER_URI, | ||
UriItemFilterProcessor.mapper(path(q -> q.handlerUriId))); | ||
addItemMapping(TriggerType.F_TIMESTAMP, | ||
TimestampItemFilterProcessor.mapper(path(q -> q.timestampValue))); | ||
} | ||
|
||
@Override | ||
protected QTrigger newAliasInstance(String alias) { | ||
return new QTrigger(alias); | ||
} | ||
|
||
// @Override TODO | ||
// public TriggerSqlTransformer createTransformer( | ||
// SqlTransformerContext transformerContext) { | ||
// return new TriggerSqlTransformer(transformerContext, this); | ||
// } | ||
|
||
@Override | ||
public MTrigger newRowObject() { | ||
return new MTrigger(); | ||
} | ||
} |
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
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
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
Oops, something went wrong.