Skip to content

Commit 1aba52b

Browse files
committed
Revert the java update from 1.8 to 11
1 parent ad97659 commit 1aba52b

File tree

4 files changed

+34
-33
lines changed

4 files changed

+34
-33
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
</developer>
2121
</developers>
2222
<properties>
23-
<java.version>11</java.version>
24-
<maven.compiler.target>11</maven.compiler.target>
23+
<java.version>1.8</java.version>
24+
<maven.compiler.target>1.8</maven.compiler.target>
2525
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2626
<spring-boot.version>2.7.18</spring-boot.version>
2727
<spring-data.version>2021.2.18</spring-data.version>

rsql-jpa-spring-boot-starter/src/main/java/io/github/perplexhub/rsql/RSQLJPAAutoConfiguration.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.util.Optional;
1313
import lombok.extern.slf4j.Slf4j;
1414
import org.hibernate.Session;
15+
import org.hibernate.SessionFactory;
1516
import org.hibernate.dialect.AbstractHANADialect;
1617
import org.hibernate.dialect.DB2Dialect;
1718
import org.hibernate.dialect.DerbyDialect;
@@ -42,7 +43,7 @@ public class RSQLJPAAutoConfiguration {
4243
public RSQLCommonSupport rsqlCommonSupport(Map<String, EntityManager> entityManagerMap,
4344
ObjectProvider<EntityManagerDatabase> entityManagerDatabaseProvider) {
4445
log.info("RSQLJPAAutoConfiguration.rsqlCommonSupport(entityManagerMap:{})", entityManagerMap.size());
45-
var entityManagerDatabase = entityManagerDatabaseProvider.getIfAvailable(() -> new EntityManagerDatabase(Map.of()));
46+
EntityManagerDatabase entityManagerDatabase = entityManagerDatabaseProvider.getIfAvailable(() -> new EntityManagerDatabase(Map.of()));
4647

4748
return new RSQLJPASupport(entityManagerMap, entityManagerDatabase.value());
4849
}
@@ -56,8 +57,8 @@ class HibernateEntityManagerDatabaseConfiguration {
5657
public EntityManagerDatabase entityManagerDatabase(ObjectProvider<EntityManager> entityManagers) {
5758
return entityManagers.stream()
5859
.map(entityManager -> {
59-
var sessionFactory = entityManager.unwrap(Session.class).getSessionFactory();
60-
var dialect = ((SessionFactoryImpl) sessionFactory).getJdbcServices().getDialect();
60+
SessionFactory sessionFactory = entityManager.unwrap(Session.class).getSessionFactory();
61+
Dialect dialect = ((SessionFactoryImpl) sessionFactory).getJdbcServices().getDialect();
6162

6263
return Optional.ofNullable(toDatabase(dialect))
6364
.map(db -> Map.entry(entityManager, db))

rsql-jpa/src/main/java/io/github/perplexhub/rsql/RSQLJPAPredicateConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,10 @@ public Predicate visit(ComparisonNode node, From root) {
326326
}
327327

328328
private Expression<?> getJsonExpression(Path<?> path, Attribute attribute, ComparisonNode node) {
329-
var database = getDatabase(attribute).orElse(null);
329+
Database database = getDatabase(attribute).orElse(null);
330330

331331
if (database == Database.POSTGRESQL) {
332-
var args = new ArrayList<Expression<?>>();
332+
List<Expression<?>> args = new ArrayList<Expression<?>>();
333333
args.add(path);
334334

335335
Stream.of(node.getSelector().split("\\."))

rsql-jpa/src/test/java/io/github/perplexhub/rsql/RSQLJPASupportPostgresJsonTest.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ static Stream<Arguments> data() {
7272
}
7373

7474
private static Stream<Arguments> equalsData() {
75-
var e1 = new PostgresJsonEntity(Map.of("a1", "b1"));
76-
var e2 = new PostgresJsonEntity(Map.of("a1", Map.of("a11", Map.of("a111", "b1"))));
75+
PostgresJsonEntity e1 = new PostgresJsonEntity(Map.of("a1", "b1"));
76+
PostgresJsonEntity e2 = new PostgresJsonEntity(Map.of("a1", Map.of("a11", Map.of("a111", "b1"))));
7777

78-
var e3 = new PostgresJsonEntity(e1);
79-
var e4 = new PostgresJsonEntity(e2);
78+
PostgresJsonEntity e3 = new PostgresJsonEntity(e1);
79+
PostgresJsonEntity e4 = new PostgresJsonEntity(e2);
8080

81-
var e5 = new PostgresJsonEntity(Map.of("a", "b1"));
82-
var e6 = new PostgresJsonEntity(Map.of("a", "b2"));
83-
var e7 = new PostgresJsonEntity(Map.of("a", "c1"));
81+
PostgresJsonEntity e5 = new PostgresJsonEntity(Map.of("a", "b1"));
82+
PostgresJsonEntity e6 = new PostgresJsonEntity(Map.of("a", "b2"));
83+
PostgresJsonEntity e7 = new PostgresJsonEntity(Map.of("a", "c1"));
8484

8585
return Stream.of(
8686
arguments(List.of(e1, e2), "properties.a1==b1", List.of(e1)),
@@ -97,10 +97,10 @@ private static Stream<Arguments> equalsData() {
9797
}
9898

9999
private static Stream<Arguments> inData() {
100-
var e1 = new PostgresJsonEntity(Map.of("a", "b1"));
101-
var e2 = new PostgresJsonEntity(Map.of("a", "b2"));
102-
var e3 = new PostgresJsonEntity(Map.of("a", "c1"));
103-
var e4 = new PostgresJsonEntity(Map.of("a", "d1"));
100+
PostgresJsonEntity e1 = new PostgresJsonEntity(Map.of("a", "b1"));
101+
PostgresJsonEntity e2 = new PostgresJsonEntity(Map.of("a", "b2"));
102+
PostgresJsonEntity e3 = new PostgresJsonEntity(Map.of("a", "c1"));
103+
PostgresJsonEntity e4 = new PostgresJsonEntity(Map.of("a", "d1"));
104104

105105
return Stream.of(
106106
arguments(List.of(e1, e2, e3, e4), "properties.a=in=(b1, c1)", List.of(e1, e3)),
@@ -111,10 +111,10 @@ private static Stream<Arguments> inData() {
111111
}
112112

113113
private static Stream<Arguments> betweenData() {
114-
var e1 = new PostgresJsonEntity(Map.of("a", "a"));
115-
var e2 = new PostgresJsonEntity(Map.of("a", "b"));
116-
var e3 = new PostgresJsonEntity(Map.of("a", "c"));
117-
var e4 = new PostgresJsonEntity(Map.of("a", "d"));
114+
PostgresJsonEntity e1 = new PostgresJsonEntity(Map.of("a", "a"));
115+
PostgresJsonEntity e2 = new PostgresJsonEntity(Map.of("a", "b"));
116+
PostgresJsonEntity e3 = new PostgresJsonEntity(Map.of("a", "c"));
117+
PostgresJsonEntity e4 = new PostgresJsonEntity(Map.of("a", "d"));
118118

119119
return Stream.of(
120120
arguments(List.of(e1, e2, e3, e4), "properties.a=bt=(a, c)", List.of(e1, e2, e3)),
@@ -123,9 +123,9 @@ private static Stream<Arguments> betweenData() {
123123
}
124124

125125
private static Stream<Arguments> likeData() {
126-
var e1 = new PostgresJsonEntity(Map.of("a", "a b c"));
127-
var e2 = new PostgresJsonEntity(Map.of("a", "b c d"));
128-
var e3 = new PostgresJsonEntity(Map.of("a", "c d e"));
126+
PostgresJsonEntity e1 = new PostgresJsonEntity(Map.of("a", "a b c"));
127+
PostgresJsonEntity e2 = new PostgresJsonEntity(Map.of("a", "b c d"));
128+
PostgresJsonEntity e3 = new PostgresJsonEntity(Map.of("a", "c d e"));
129129

130130
return Stream.of(
131131
arguments(List.of(e1, e2, e3), "properties.a=ke='a b'", List.of(e1)),
@@ -144,10 +144,10 @@ private static Stream<Arguments> likeData() {
144144
}
145145

146146
private static Stream<Arguments> gtLtData() {
147-
var e1 = new PostgresJsonEntity(Map.of("a", "a"));
148-
var e2 = new PostgresJsonEntity(Map.of("a", "b"));
149-
var e3 = new PostgresJsonEntity(Map.of("a", "c"));
150-
var e4 = new PostgresJsonEntity(Map.of("a", "d"));
147+
PostgresJsonEntity e1 = new PostgresJsonEntity(Map.of("a", "a"));
148+
PostgresJsonEntity e2 = new PostgresJsonEntity(Map.of("a", "b"));
149+
PostgresJsonEntity e3 = new PostgresJsonEntity(Map.of("a", "c"));
150+
PostgresJsonEntity e4 = new PostgresJsonEntity(Map.of("a", "d"));
151151

152152
return Stream.of(
153153
arguments(List.of(e1, e2, e3, e4), "properties.a>=a", List.of(e1, e2, e3, e4)),
@@ -160,10 +160,10 @@ private static Stream<Arguments> gtLtData() {
160160
}
161161

162162
private static Stream<Arguments> miscData() {
163-
var e1 = new PostgresJsonEntity(Map.of("a", "b1"));
164-
var e2 = new PostgresJsonEntity(Map.of("a", "b2"));
165-
var e3 = new PostgresJsonEntity(Map.of("b", "c1"));
166-
var e4 = new PostgresJsonEntity(Map.of("b", "d1"));
163+
PostgresJsonEntity e1 = new PostgresJsonEntity(Map.of("a", "b1"));
164+
PostgresJsonEntity e2 = new PostgresJsonEntity(Map.of("a", "b2"));
165+
PostgresJsonEntity e3 = new PostgresJsonEntity(Map.of("b", "c1"));
166+
PostgresJsonEntity e4 = new PostgresJsonEntity(Map.of("b", "d1"));
167167

168168
return Stream.of(
169169
arguments(List.of(e1, e2, e3, e4), "properties.a=nn=''", List.of(e1, e2)),

0 commit comments

Comments
 (0)