Skip to content

Commit

Permalink
Removing obsolete code, ancient modules and dropped features
Browse files Browse the repository at this point in the history
  • Loading branch information
velo committed Sep 21, 2024
1 parent e2bad28 commit c9a571b
Show file tree
Hide file tree
Showing 110 changed files with 87 additions and 11,974 deletions.
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
</distributionManagement>

<properties>
<!-- removing old modules on 7.0 release -->
<japicmp.skip>true</japicmp.skip>

<failIfNoTests>false</failIfNoTests>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.homepage>http://www.querydsl.com</project.homepage>
Expand Down
5 changes: 3 additions & 2 deletions querydsl-libraries/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@
<exclude>org.hibernate:hibernate-envers:*:*:compile</exclude>
<exclude>org.hibernate.validator:hibernate-validator:*:*:compile</exclude>
<exclude>org.eclipse.persistence:eclipselink:*:*:compile</exclude>
<exclude>org.datanucleus:javax.jdo:*:*:compile</exclude>
<exclude>org.springframework.roo:org.springframework.roo.annotations:*:*:compile</exclude>
<exclude>org.mongodb.morphia:morphia:*:*:compile</exclude>
<exclude>org.joda:joda-money:*:*:compile</exclude>
<exclude>org.batoo.jpa:batoo-jpa:*:*:compile</exclude>
Expand All @@ -112,6 +110,9 @@
<exclude>jakarta.xml.bind:jakarta.xml.bind-api:*:*:compile</exclude>
<!-- Ban any API's that were moved to jakarta -->
<exclude>javax.*:*:*:*:*</exclude>
<!-- Ban libraries that support was dropped -->
<exclude>org.datanucleus:javax.jdo:*:*:*</exclude>
<exclude>org.springframework.roo:org.springframework.roo.annotations:*:*:compile</exclude>
<!-- The following database drivers should be in test scope -->
<exclude>org.hsqldb:hsqldb:*:*:compile</exclude>
<exclude>com.h2database:h2:*:*:compile</exclude>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public Collection<Predicate> string(
rv.add(expr.notBetween("A", "Z"));
rv.add(expr.notBetween(other, other));

if (!target.equals(Target.DERBY) && !module.equals(QuerydslModule.JDO)) {
if (!target.equals(Target.DERBY)) {
// https://issues.apache.org/jira/browse/DERBY-4389
rv.add(new Coalesce<>(String.class, expr, other).getValue().eq("xxx"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public Collection<Predicate> date(
rv.add(expr.dayOfMonth().eq(other.dayOfMonth()));

if (!target.equals(Target.DERBY)
&& !module.equals(QuerydslModule.JDO)
&& !target.equals(Target.ORACLE)
&& !target.equals(Target.FIREBIRD)
&& (!target.equals(Target.POSTGRESQL) || !module.equals(QuerydslModule.JPA))) {
Expand Down Expand Up @@ -134,7 +133,6 @@ public Collection<Predicate> dateTime(
rv.add(expr.dayOfMonth().eq(other.dayOfMonth()));

if (!target.equals(Target.DERBY)
&& !module.equals(QuerydslModule.JDO)
&& !target.equals(Target.ORACLE)
&& (!target.equals(Target.POSTGRESQL) || !module.equals(QuerydslModule.JPA))) {
rv.add(expr.dayOfWeek().eq(other.dayOfWeek()));
Expand Down Expand Up @@ -210,12 +208,10 @@ public <A extends Number & Comparable<A>> Collection<Predicate> numeric(

public Collection<Predicate> string(StringExpression expr, StringExpression other) {
var rv = new HashSet<Predicate>();
if (module != QuerydslModule.LUCENE) {
rv.addAll(comparable(expr, other));
rv.addAll(comparable(expr, other));

rv.add(expr.charAt(0).eq(other.charAt(0)));
rv.add(expr.charAt(1).eq(other.charAt(1)));
}
rv.add(expr.charAt(0).eq(other.charAt(0)));
rv.add(expr.charAt(1).eq(other.charAt(1)));

rv.add(expr.contains(other));
rv.add(expr.contains(other.substring(0, 1)));
Expand Down Expand Up @@ -244,58 +240,50 @@ public Collection<Predicate> string(StringExpression expr, StringExpression othe
rv.add(expr.eq(other));
rv.add(expr.equalsIgnoreCase(other));

if (module != QuerydslModule.LUCENE) {
rv.add(expr.indexOf(other).eq(0));
rv.add(expr.locate(other).eq(1));
}
rv.add(expr.indexOf(other).eq(0));
rv.add(expr.locate(other).eq(1));

if (target != Target.DERBY && module != QuerydslModule.LUCENE) {
if (target != Target.DERBY) {
rv.add(expr.indexOf(other.substring(1)).eq(1));
rv.add(expr.indexOf(other.substring(2)).eq(2));
}

if (module != QuerydslModule.LUCENE) {
rv.add(expr.isEmpty().not());
rv.add(expr.isNotEmpty());
}
rv.add(expr.isEmpty().not());
rv.add(expr.isNotEmpty());

if (module != QuerydslModule.LUCENE) {
rv.add(expr.length().eq(other.length()));
rv.add(expr.like(other));
rv.add(expr.length().eq(other.length()));
rv.add(expr.like(other));

if (module != QuerydslModule.JDO || other instanceof Constant<?>) {
rv.add(expr.like(other.substring(0, 1).append("%")));
rv.add(expr.like(other.substring(0, 1).append("%").append(other.substring(2))));
rv.add(expr.like(other.substring(1).prepend("%")));
rv.add(expr.like(other.substring(1, 2).append("%").prepend("%")));
}
if (other instanceof Constant<?>) {
rv.add(expr.like(other.substring(0, 1).append("%")));
rv.add(expr.like(other.substring(0, 1).append("%").append(other.substring(2))));
rv.add(expr.like(other.substring(1).prepend("%")));
rv.add(expr.like(other.substring(1, 2).append("%").prepend("%")));
}

rv.add(expr.lower().eq(other.lower()));

if (module != QuerydslModule.LUCENE) {
if (!module.equals(QuerydslModule.SQL)
|| (!target.equals(Target.HSQLDB)
&& !target.equals(Target.FIREBIRD)
&& !target.equals(Target.H2)
&& !target.equals(Target.DB2)
&& !target.equals(Target.DERBY)
&& !target.equals(Target.SQLITE)
&& !target.equals(Target.SQLSERVER))) {

rv.add(expr.matches(other));

if (module != QuerydslModule.JDO || other instanceof Constant<?>) {
rv.add(expr.matches(other.substring(0, 1).append(".*")));
rv.add(expr.matches(other.substring(0, 1).append(".").append(other.substring(2))));
rv.add(expr.matches(other.substring(1).prepend(".*")));
rv.add(expr.matches(other.substring(1, 2).prepend(".*").append(".*")));
}
if (!module.equals(QuerydslModule.SQL)
|| (!target.equals(Target.HSQLDB)
&& !target.equals(Target.FIREBIRD)
&& !target.equals(Target.H2)
&& !target.equals(Target.DB2)
&& !target.equals(Target.DERBY)
&& !target.equals(Target.SQLITE)
&& !target.equals(Target.SQLSERVER))) {

rv.add(expr.matches(other));

if (other instanceof Constant<?>) {
rv.add(expr.matches(other.substring(0, 1).append(".*")));
rv.add(expr.matches(other.substring(0, 1).append(".").append(other.substring(2))));
rv.add(expr.matches(other.substring(1).prepend(".*")));
rv.add(expr.matches(other.substring(1, 2).prepend(".*").append(".*")));
}

rv.add(expr.ne(other));
}

rv.add(expr.ne(other));

rv.add(expr.startsWith(other));
rv.add(expr.startsWith(other.substring(0, 1)));
rv.add(expr.startsWith(other.substring(0, 2)));
Expand All @@ -304,13 +292,11 @@ public Collection<Predicate> string(StringExpression expr, StringExpression othe
rv.add(expr.startsWithIgnoreCase(other.substring(0, 1)));
rv.add(expr.startsWithIgnoreCase(other.substring(0, 2)));

if (module != QuerydslModule.LUCENE) {
rv.add(expr.substring(0, 1).eq(other.substring(0, 1)));
rv.add(expr.substring(1, 2).eq(other.substring(1, 2)));
rv.add(expr.substring(1).eq(other.substring(1)));
rv.add(expr.substring(0, 1).eq(other.substring(0, 1)));
rv.add(expr.substring(1, 2).eq(other.substring(1, 2)));
rv.add(expr.substring(1).eq(other.substring(1)));

rv.add(expr.trim().eq(other.trim()));
}
rv.add(expr.trim().eq(other.trim()));

rv.add(expr.upper().eq(other.upper()));
return Collections.unmodifiableSet(rv);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ private <A extends Number & Comparable<A>> Collection<NumberExpression<?>> numer
rv.add(expr.countDistinct());
}

if (!(other instanceof Constant<?>
|| module == QuerydslModule.JDO
|| module == QuerydslModule.RDFBEAN)) {
if (!(other instanceof Constant<?> || module == QuerydslModule.RDFBEAN)) {
var cases = new CaseBuilder();
rv.add(
NumberConstant.create(1)
Expand Down Expand Up @@ -218,9 +216,7 @@ public Collection<SimpleExpression<String>> stringProjections(
rv.add(expr.substring(1));
rv.add(expr.substring(0, 1));

if (!(other instanceof Constant<?>
|| module == QuerydslModule.JDO
|| module == QuerydslModule.RDFBEAN)) {
if (!(other instanceof Constant<?> || module == QuerydslModule.RDFBEAN)) {
var cases = new CaseBuilder();
rv.add(cases.when(expr.eq("A")).then(other).when(expr.eq("B")).then(expr).otherwise(other));

Expand All @@ -231,9 +227,7 @@ public Collection<SimpleExpression<String>> stringProjections(

rv.add(expr.upper());

if (module != QuerydslModule.JDO) {
rv.add(expr.nullif("xxx"));
}
rv.add(expr.nullif("xxx"));

return Collections.unmodifiableSet(rv);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ public enum QuerydslModule {
/** */
JPA,
/** */
JDO,
/** */
RDFBEAN,
/** */
SQL,
/** */
LUCENE;
}
Loading

0 comments on commit c9a571b

Please sign in to comment.