Skip to content

Commit 4271aad

Browse files
committed
Update examples.
1 parent 92a7cef commit 4271aad

File tree

5 files changed

+0
-152
lines changed

5 files changed

+0
-152
lines changed

kilo-test/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ dependencies {
2020
compileOnly "jakarta.servlet:jakarta.servlet-api:${servletAPIVersion}"
2121

2222
implementation project(':kilo-server')
23-
2423
implementation "org.mariadb.jdbc:mariadb-java-client:${connectorJVersion}"
25-
implementation 'org.hibernate.orm:hibernate-core:6.6.23.Final'
2624

2725
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
2826

kilo-test/src/main/java/org/httprpc/kilo/test/EmployeeService.java

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import jakarta.servlet.ServletException;
1818
import jakarta.servlet.annotation.WebServlet;
19-
import org.hibernate.cfg.Configuration;
2019
import org.httprpc.kilo.RequestMethod;
2120
import org.httprpc.kilo.ResourcePath;
2221
import org.httprpc.kilo.WebService;
@@ -83,46 +82,4 @@ public Iterable<Employee> getEmployeesStream() {
8382

8483
return pipe;
8584
}
86-
87-
@RequestMethod("GET")
88-
@ResourcePath("hibernate")
89-
public List<Employee> getEmployeesHibernate() {
90-
var configuration = new Configuration();
91-
92-
configuration.addAnnotatedClass(HibernateEmployee.class);
93-
94-
try (var sessionFactory = configuration.configure().buildSessionFactory();
95-
var session = sessionFactory.withOptions().connection(getConnection()).openSession()) {
96-
var criteriaQuery = session.getCriteriaBuilder().createQuery(Employee.class);
97-
var query = session.createQuery(criteriaQuery.select(criteriaQuery.from(HibernateEmployee.class)));
98-
99-
return query.list();
100-
}
101-
}
102-
103-
@RequestMethod("GET")
104-
@ResourcePath("hibernate-stream")
105-
public Iterable<Employee> getEmployeesHibernateStream() {
106-
var pipe = new Pipe<Employee>(4096, 15000);
107-
108-
var connection = getConnection();
109-
110-
executorService.submit(() -> {
111-
var configuration = new Configuration();
112-
113-
configuration.addAnnotatedClass(HibernateEmployee.class);
114-
115-
try (var sessionFactory = configuration.configure().buildSessionFactory();
116-
var session = sessionFactory.withOptions().connection(connection).openSession()) {
117-
var criteriaQuery = session.getCriteriaBuilder().createQuery(Employee.class);
118-
var query = session.createQuery(criteriaQuery.select(criteriaQuery.from(HibernateEmployee.class)));
119-
120-
try (var stream = query.stream()) {
121-
pipe.submit(stream);
122-
}
123-
}
124-
});
125-
126-
return pipe;
127-
}
12885
}

kilo-test/src/main/java/org/httprpc/kilo/test/HibernateEmployee.java

Lines changed: 0 additions & 94 deletions
This file was deleted.

kilo-test/src/main/resources/hibernate.cfg.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

kilo-test/src/test/java/org/httprpc/kilo/test/EmployeesTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ public static void main(String[] args) throws IOException {
2626

2727
logTiming(baseURI, "employees");
2828
logTiming(baseURI, "employees/stream");
29-
logTiming(baseURI, "employees/hibernate");
30-
logTiming(baseURI, "employees/hibernate-stream");
3129
}
3230

3331
private static void logTiming(URI baseURI, String path) throws IOException {

0 commit comments

Comments
 (0)