Skip to content

Commit

Permalink
Update Hibernate settings
Browse files Browse the repository at this point in the history
  • Loading branch information
JayPi4c committed Jan 7, 2024
1 parent 0328f2b commit dadcb70
Show file tree
Hide file tree
Showing 6 changed files with 758 additions and 746 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<junit.version>5.8.2</junit.version>
<derby.version>10.17.1.0</derby.version>
<lombok.version>1.18.30</lombok.version>
<hibernate.version>6.1.2.Final</hibernate.version>
</properties>

<build>
Expand Down Expand Up @@ -141,7 +142,12 @@
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>6.1.2.Final</version>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ public static Optional<List<String>> getAllTags() {
List<String> tags;
try (Session session = HibernateUtils.getSessionFactory().openSession()) {
List<Example> allExamples = session.createQuery("from Example", Example.class).list();
logger.debug("Found {} examples", allExamples.size());
tags = allExamples.stream().flatMap(ex -> ex.getTags().stream()).distinct().toList();
}
return Optional.ofNullable(tags);
return Optional.of(tags);
}

}
Loading

0 comments on commit dadcb70

Please sign in to comment.