Skip to content

Commit abd16b9

Browse files
chore: bump spring-boot-dependencies to version 2.6.7
1 parent b8c6e34 commit abd16b9

File tree

5 files changed

+22
-26
lines changed

5 files changed

+22
-26
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<dependency>
6565
<groupId>org.springframework.boot</groupId>
6666
<artifactId>spring-boot-dependencies</artifactId>
67-
<version>2.3.9.RELEASE</version>
67+
<version>2.6.7</version>
6868
<type>pom</type>
6969
<scope>import</scope>
7070
</dependency>

src/main/java/org/springframework/data/jpa/datatables/AbstractPredicateBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ public boolean hasPrevious() {
126126
public int getPageNumber() {
127127
throw new UnsupportedOperationException();
128128
}
129+
130+
@Override
131+
public Pageable withPage(int pageNumber) {
132+
throw new UnsupportedOperationException();
133+
}
129134
}
130135

131136
}

src/test/java/org/springframework/data/jpa/datatables/Config.java

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import javax.sql.DataSource;
2020
import java.sql.SQLException;
21+
import java.util.Properties;
2122

2223
/**
2324
* Spring JavaConfig configuration for general infrastructure.
@@ -61,23 +62,13 @@ public SessionFactory entityManagerFactory(DataSource dataSource) throws Excepti
6162
LocalSessionFactoryBean factory = new LocalSessionFactoryBean();
6263
factory.setPackagesToScan(Config.class.getPackage().getName());
6364
factory.setDataSource(dataSource);
64-
factory.afterPropertiesSet();
65-
return factory.getObject();
66-
}
67-
68-
@Bean
69-
public AbstractEntityManagerFactoryBean entityManager(DataSource dataSource)
70-
throws SQLException {
71-
72-
HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
73-
jpaVendorAdapter.setGenerateDdl(true);
7465

75-
LocalContainerEntityManagerFactoryBean bean = new LocalContainerEntityManagerFactoryBean();
76-
bean.setJpaVendorAdapter(jpaVendorAdapter);
77-
bean.setPackagesToScan(Config.class.getPackage().getName());
78-
bean.setDataSource(dataSource);
66+
Properties properties = new Properties();
67+
properties.setProperty("hibernate.hbm2ddl.auto", "create");
68+
factory.setHibernateProperties(properties);
7969

80-
return bean;
70+
factory.afterPropertiesSet();
71+
return factory.getObject();
8172
}
8273

8374
@Bean

src/test/java/org/springframework/data/jpa/datatables/model/Employee.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@
77
import lombok.experimental.Tolerate;
88

99
import javax.persistence.*;
10+
import java.util.Comparator;
1011
import java.util.List;
12+
import java.util.stream.Collectors;
1113

1214
import static java.util.Arrays.asList;
15+
import static java.util.Comparator.comparingInt;
16+
import static java.util.Comparator.reverseOrder;
17+
import static java.util.stream.Collectors.toList;
1318

1419
@Data
1520
@Setter(AccessLevel.NONE)
@@ -102,13 +107,9 @@ private Employee() {}
102107
BRIELLE_WILLIAMSON
103108
);
104109

105-
public static List<Employee> ALL_SORTED_BY_AGE = asList(
106-
BRENDEN_WAGNER,
107-
AIRI_SATOU,
108-
BRADLEY_GREER,
109-
ANGELICA_RAMOS,
110-
BRIELLE_WILLIAMSON,
111-
ASHTON_COX
112-
);
110+
public static List<Employee> ALL_SORTED_BY_AGE =
111+
ALL.stream().sorted(comparingInt(e -> e.age)).collect(toList());
113112

113+
public static List<Employee> ALL_SORTED_BY_AGE_DESC =
114+
ALL.stream().sorted(comparingInt(e -> -e.age)).collect(toList());
114115
}

src/test/java/org/springframework/data/jpa/datatables/repository/EmployeeRepositoryTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.springframework.data.jpa.datatables.repository;
22

3-
import com.google.common.collect.Lists;
43
import org.junit.Before;
54
import org.junit.Test;
65
import org.junit.runner.RunWith;
@@ -88,7 +87,7 @@ public void sortDescending() {
8887
input.addOrder("age", false);
8988

9089
DataTablesOutput<Employee> output = getOutput(input);
91-
assertThat(output.getData()).containsExactlyElementsOf(Lists.reverse(Employee.ALL_SORTED_BY_AGE));
90+
assertThat(output.getData()).containsExactlyElementsOf(Employee.ALL_SORTED_BY_AGE_DESC);
9291
}
9392

9493
@Test

0 commit comments

Comments
 (0)