-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sqale: Added mapping and table for assignment/valueMetadata
- Loading branch information
1 parent
64e7c3d
commit add45ae
Showing
18 changed files
with
599 additions
and
21 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
22 changes: 22 additions & 0 deletions
22
...src/main/java/com/evolveum/midpoint/repo/sqale/qmodel/assignment/MAssignmentMetadata.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,22 @@ | ||
package com.evolveum.midpoint.repo.sqale.qmodel.assignment; | ||
|
||
import com.evolveum.midpoint.repo.sqale.qmodel.metadata.MValueMetadata; | ||
|
||
import com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; | ||
|
||
import com.querydsl.core.types.dsl.BooleanExpression; | ||
|
||
public class MAssignmentMetadata extends MValueMetadata implements MAssignmentReference.Owner { | ||
|
||
public MObjectType ownerType; | ||
public Long assignmentCid; | ||
|
||
@Override | ||
public BooleanExpression owns(QAssignmentReference ref) { | ||
return ref.ownerOid.eq(ownerOid) | ||
.and(ref.assignmentCid.eq(assignmentCid)) | ||
.and(ref.metadataCid.eq(cid)); | ||
} | ||
|
||
} |
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
31 changes: 31 additions & 0 deletions
31
...src/main/java/com/evolveum/midpoint/repo/sqale/qmodel/assignment/QAssignmentMetadata.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,31 @@ | ||
package com.evolveum.midpoint.repo.sqale.qmodel.assignment; | ||
|
||
import com.evolveum.midpoint.repo.sqale.qmodel.metadata.QValueMetadata; | ||
import com.evolveum.midpoint.repo.sqale.qmodel.metadata.QValueMetadataMapping; | ||
|
||
import com.querydsl.core.types.dsl.BooleanExpression; | ||
import com.querydsl.core.types.dsl.NumberPath; | ||
import com.querydsl.sql.ColumnMetadata; | ||
|
||
import java.sql.Types; | ||
|
||
public class QAssignmentMetadata extends QValueMetadata<MAssignmentMetadata, MAssignment> { | ||
|
||
public static final String TABLE_NAME = "m_assignment_metadata"; | ||
public static final String ALIAS = "am"; | ||
|
||
public static final ColumnMetadata ASSIGNMENT_CID = | ||
ColumnMetadata.named("assignmentCid").ofType(Types.BIGINT).notNull(); | ||
|
||
public final NumberPath<Long> assignmentCid = createLong("assignmentCid", ASSIGNMENT_CID); | ||
|
||
public QAssignmentMetadata(String variable) { | ||
super(MAssignmentMetadata.class, variable, DEFAULT_SCHEMA_NAME, TABLE_NAME); | ||
} | ||
|
||
@Override | ||
public BooleanExpression isOwnedBy(MAssignment ownerRow) { | ||
return ownerOid.eq(ownerRow.ownerOid) | ||
.and(assignmentCid.eq(ownerRow.cid)); | ||
} | ||
} |
Oops, something went wrong.