Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump h2 from 1.3.176 to 2.2.220 #5103

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions modules/asset-manager-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,22 @@
</dependency>
<!-- Querydsl -->
<dependency>
<groupId>com.mysema.querydsl</groupId>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
</dependency>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-sql-spatial</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
Expand Down Expand Up @@ -210,7 +214,6 @@
<!-- provides database for testing -->
<ignoredUnusedDeclaredDependency>com.h2database:h2</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>javax.servlet:javax.servlet-api</ignoredUnusedDeclaredDependency>
<ignoredUnusedDeclaredDependency>com.mysema.querydsl:querydsl-apt</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>
Expand Down Expand Up @@ -242,7 +245,7 @@
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
package org.opencastproject.assetmanager.impl.persistence;

import static com.entwinemedia.fn.Stream.$;
import static com.mysema.query.types.PathMetadataFactory.forVariable;
import static com.querydsl.core.types.PathMetadataFactory.forVariable;

import org.opencastproject.assetmanager.api.Availability;
import org.opencastproject.assetmanager.impl.VersionImpl;

import com.entwinemedia.fn.Fn;
import com.entwinemedia.fn.data.ListBuilders;
import com.mysema.query.Tuple;
import com.mysema.query.jpa.impl.JPAQuery;
import com.mysema.query.types.Expression;
import com.mysema.query.types.path.PathInits;
import com.querydsl.core.Tuple;
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.dsl.PathInits;
import com.querydsl.jpa.impl.JPAQuery;

import javax.persistence.EntityManager;

Expand Down Expand Up @@ -105,8 +105,8 @@ public String getOwner() {

/**
* Parameter for query execution methods like
* {@link com.mysema.query.jpa.impl.JPAQuery#singleResult(com.mysema.query.types.Expression[])} or
* {@link com.mysema.query.jpa.impl.JPAQuery#list(Expression[])}.
* {@link com.com.querydsl.jpa.JPAQuery#singleResult(com.querydsl.core.types.Expression[])} or
* {@link com.com.querydsl.jpa.JPAQuery#list(Expression[])}.
*/
public static final Expression<?>[] select = new Expression[] {
QAssetDto.assetDto,
Expand Down Expand Up @@ -148,8 +148,8 @@ public VersionImpl getVersion() {

/**
* Parameter for query execution methods like
* {@link com.mysema.query.jpa.impl.JPAQuery#singleResult(com.mysema.query.types.Expression[])} or
* {@link com.mysema.query.jpa.impl.JPAQuery#list(Expression[])}.
* {@link com.com.querydsl.jpa.JPAQuery#singleResult(com.querydsl.core.types.Expression[])} or
* {@link com.com.querydsl.jpa.JPAQuery#list(Expression[])}.
*/
public static final Expression<?>[] select =
$(Medium.select).append(ListBuilders.SIA.mk(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
import org.opencastproject.util.data.Function;

import com.entwinemedia.fn.data.Opt;
import com.mysema.query.Tuple;
import com.mysema.query.jpa.EclipseLinkTemplates;
import com.mysema.query.jpa.JPQLTemplates;
import com.mysema.query.jpa.impl.JPADeleteClause;
import com.mysema.query.jpa.impl.JPAQuery;
import com.mysema.query.jpa.impl.JPAQueryFactory;
import com.mysema.query.jpa.impl.JPAUpdateClause;
import com.mysema.query.types.expr.BooleanExpression;
import com.querydsl.core.Tuple;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.EclipseLinkTemplates;
import com.querydsl.jpa.JPQLTemplates;
import com.querydsl.jpa.impl.JPADeleteClause;
import com.querydsl.jpa.impl.JPAQuery;
import com.querydsl.jpa.impl.JPAQueryFactory;
import com.querydsl.jpa.impl.JPAUpdateClause;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import static com.entwinemedia.fn.Stream.empty;

import com.entwinemedia.fn.Stream;
import com.mysema.query.types.EntityPath;
import com.querydsl.core.types.EntityPath;

/**
* Shortcuts to Querydsl entity paths.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import org.opencastproject.assetmanager.api.Availability;

import com.entwinemedia.fn.Fn;
import com.mysema.query.Tuple;
import com.mysema.query.jpa.impl.JPAQuery;
import com.mysema.query.types.Expression;
import com.querydsl.core.Tuple;
import com.querydsl.core.types.Expression;
import com.querydsl.jpa.impl.JPAQuery;

import javax.persistence.EntityManager;

Expand Down Expand Up @@ -102,8 +102,8 @@ public String getOwner() {

/**
* Parameter for query execution methods like
* {@link com.mysema.query.jpa.impl.JPAQuery#singleResult(com.mysema.query.types.Expression[])} or
* {@link com.mysema.query.jpa.impl.JPAQuery#list(Expression[])}.
* {@link com.com.querydsl.jpa.JPAQuery#singleResult(com.querydsl.core.types.Expression[])} or
* {@link com.com.querydsl.jpa.JPAQuery#list(Expression[])}.
*/
public static final Expression<?>[] select = new Expression[] {
QSnapshotDto.snapshotDto,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
import com.entwinemedia.fn.Fn;
import com.entwinemedia.fn.Stream;
import com.entwinemedia.fn.data.Opt;
import com.mysema.query.jpa.impl.JPAQueryFactory;
import com.mysema.query.support.Expressions;
import com.mysema.query.types.expr.BooleanExpression;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.Expressions;
import com.querydsl.jpa.impl.JPAQueryFactory;

import java.util.Date;

Expand All @@ -63,7 +63,7 @@ public AQueryBuilderImpl(AssetManagerImpl am) {
this.am = am;
}

/** Convert a {@link Target} into a Querydsl {@link com.mysema.query.types.Expression}. */
/** Convert a {@link Target} into a Querydsl {@link com.querydsl.core.types.Expression}. */
private static Fn<Target, SelectQueryContribution> contributeSelect(final JPAQueryFactory f) {
return new Fn<Target, SelectQueryContribution>() {
@Override public SelectQueryContribution apply(Target t) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@

import com.entwinemedia.fn.Fn;
import com.entwinemedia.fn.data.SetB;
import com.mysema.query.Tuple;
import com.mysema.query.jpa.JPASubQuery;
import com.mysema.query.jpa.impl.JPADeleteClause;
import com.mysema.query.jpa.impl.JPAQueryFactory;
import com.mysema.query.support.Expressions;
import com.mysema.query.types.EntityPath;
import com.mysema.query.types.expr.BooleanExpression;
import com.querydsl.core.Tuple;
import com.querydsl.core.types.EntityPath;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.Expressions;
import com.querydsl.jpa.impl.JPADeleteClause;
import com.querydsl.jpa.impl.JPAQueryFactory;
import com.querydsl.sql.SQLExpressions;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -233,12 +233,11 @@ private DeletionResult runQueries(JPAQueryFactory jpa, DeleteQueryContribution c
WHERE (t2.organization_id = ?)
*/
where = Q_PROPERTY.mediaPackageId.in(
new JPASubQuery()
.from(Q_PROPERTY)
.join(Q_SNAPSHOT)
SQLExpressions.select(Q_PROPERTY)
.leftJoin(Q_SNAPSHOT)
// move the join condition from the "ON" clause (mediapackage_id) to the
// where clause. Find an explanation above.
.where(Q_PROPERTY.mediaPackageId.eq(Q_SNAPSHOT.mediaPackageId).and(w))
.on(Q_PROPERTY.mediaPackageId.eq(Q_SNAPSHOT.mediaPackageId).and(w))
.distinct()
.list(Q_PROPERTY.mediaPackageId));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
import com.entwinemedia.fn.data.Opt;
import com.entwinemedia.fn.data.SetB;
import com.entwinemedia.fn.fns.Booleans;
import com.mysema.query.Tuple;
import com.mysema.query.jpa.impl.JPAQuery;
import com.mysema.query.jpa.impl.JPAQueryFactory;
import com.mysema.query.types.EntityPath;
import com.mysema.query.types.Expression;
import com.mysema.query.types.OrderSpecifier;
import com.mysema.query.types.expr.BooleanExpression;
import com.querydsl.core.Tuple;
import com.querydsl.core.types.EntityPath;
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.OrderSpecifier;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.impl.JPAQuery;
import com.querydsl.jpa.impl.JPAQueryFactory;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -200,7 +200,7 @@ public Map<EntityPath<?>, BooleanExpression> apply(Map<EntityPath<?>, BooleanExp
{
// run query
am.getDatabase().logQuery(q);
final List<Tuple> result = q.list(JpaFns.toExpressionArray(fetch));
final List<Tuple> result = q.select(JpaFns.toExpressionArray(fetch)).fetch();
logger.debug("Pure query ms " + (System.nanoTime() - startTime) / 1000000);
// map result based on the fact whether properties have been fetched or not
if (!toFetchProperties) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import org.opencastproject.assetmanager.impl.RuntimeTypes;

import com.entwinemedia.fn.Fn2;
import com.mysema.query.jpa.impl.JPAQueryFactory;
import com.mysema.query.types.expr.BooleanExpression;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.jpa.impl.JPAQueryFactory;

public abstract class AbstractPredicate implements Predicate, QueryContributor {
private final AbstractPredicate self = this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@

import com.entwinemedia.fn.Fn;
import com.entwinemedia.fn.data.Opt;
import com.mysema.query.jpa.JPASubQuery;
import com.mysema.query.jpa.impl.JPAQueryFactory;
import com.mysema.query.types.ConstantImpl;
import com.mysema.query.types.EntityPath;
import com.mysema.query.types.Operator;
import com.mysema.query.types.Ops;
import com.mysema.query.types.expr.BooleanExpression;
import com.mysema.query.types.expr.BooleanOperation;
import com.mysema.query.types.expr.ComparableExpressionBase;
import com.querydsl.core.types.ConstantImpl;
import com.querydsl.core.types.Operator;
import com.querydsl.core.types.Ops;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.ComparableExpressionBase;
import com.querydsl.core.types.dsl.Expressions;
import com.querydsl.sql.SQLExpressions;

/**
* Generic implementation to query {@link org.opencastproject.assetmanager.impl.persistence.SnapshotDto} fields.
Expand Down Expand Up @@ -144,7 +142,7 @@ protected static Predicate mkPredicate(final BooleanExpression where) {
if (from instanceof QSnapshotDto) {
return where;
} else if (from instanceof QPropertyDto) {
return new JPASubQuery().from(Q_SNAPSHOT)
return SQLExpressions.select(Q_SNAPSHOT)
.where(Q_SNAPSHOT.mediaPackageId.eq(Q_PROPERTY.mediaPackageId).and(where))
.exists();
} else {
Expand All @@ -159,17 +157,17 @@ protected static Predicate mkPredicate(final BooleanExpression where) {
/**
* Create a predicate for comparisons with a constant value.
*/
private Predicate mkComparison(final Operator<? super Boolean> op, A right) {
return mkPredicate(BooleanOperation.create(op, path, ConstantImpl.create(extract(right))));
private Predicate mkComparison(final Operator op, A right) {
return mkPredicate(Expressions.booleanOperation(op, path, ConstantImpl.create(extract(right))));
}

/**
* Create a predicate for comparisons with a property field.
*/
private Predicate mkComparison(final Operator<? super Boolean> op, final PropertyField<A> right) {
private Predicate mkComparison(final Operator op, final PropertyField<A> right) {
return mkPredicate(PropertyPredicates.mkWhereSelect(right.name(), new Fn<QPropertyDto, Opt<BooleanExpression>>() {
@Override public Opt<BooleanExpression> apply(QPropertyDto qPropertyDto) {
return Opt.some(BooleanOperation.create(op, path, RuntimeTypes.convert(right).getPath(qPropertyDto)));
return Opt.some(Expressions.booleanOperation(op, path, RuntimeTypes.convert(right).getPath(qPropertyDto)));
}
}));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import com.entwinemedia.fn.Fn;
import com.entwinemedia.fn.Stream;
import com.entwinemedia.fn.data.Opt;
import com.mysema.query.types.EntityPath;
import com.mysema.query.types.expr.BooleanExpression;
import com.querydsl.core.types.EntityPath;
import com.querydsl.core.types.dsl.BooleanExpression;

import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
package org.opencastproject.assetmanager.impl.query;

import com.entwinemedia.fn.Fn;
import com.mysema.query.types.EntityPath;
import com.mysema.query.types.expr.BooleanExpression;
import com.querydsl.core.types.EntityPath;
import com.querydsl.core.types.dsl.BooleanExpression;

final class Join {
// CHECKSTYLE:OFF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
import com.entwinemedia.fn.Fn2;
import com.entwinemedia.fn.Fns;
import com.entwinemedia.fn.data.Opt;
import com.mysema.query.support.Expressions;
import com.mysema.query.types.EntityPath;
import com.mysema.query.types.Expression;
import com.mysema.query.types.expr.BooleanExpression;
import com.querydsl.core.types.EntityPath;
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.dsl.BooleanExpression;
import com.querydsl.core.types.dsl.Expressions;

import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
Expand Down
Loading