Skip to content

Commit

Permalink
RefItemFilterProcessor: removed unnecessary null check + typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Jun 13, 2022
1 parent efadf6c commit ea9757c
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

/**
* Filter processor for reference item paths embedded in table as three columns.
* OID is represented by UUID column, type by ID (see {@link MObjectType} and relation
* OID is represented by UUID column, type by ID (see {@link MObjectType}) and relation
* by Integer (foreign key) to {@link QUri}.
*/
public class RefItemFilterProcessor extends ItemValueFilterProcessor<RefFilter> {
Expand Down Expand Up @@ -120,9 +120,7 @@ public Predicate process(RefFilter filter) throws RepositoryException {
private Predicate targetFilterPredicate(@Nullable QName targetType, ObjectFilter targetFilter)
throws RepositoryException {
targetType = targetType != null ? targetType : ObjectType.COMPLEX_TYPE;
var targetClass = targetType != null
? context.prismContext().getSchemaRegistry().getCompileTimeClassForObjectType(targetType)
: ObjectType.class;
var targetClass = context.prismContext().getSchemaRegistry().getCompileTimeClassForObjectType(targetType);
var subquery = context.subquery(context.repositoryContext().getMappingBySchemaType(targetClass));
var targetPath = subquery.path(QObject.class);
subquery.sqlQuery().where(oidPath.eq(targetPath.oid));
Expand Down

0 comments on commit ea9757c

Please sign in to comment.