Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed redundant pom.xml repositories property. #2

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,4 @@
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>maven_central</id>
<name>Maven Central</name>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
</repositories>

</project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package mate.academy.bookstore.repository.impl;

import jakarta.persistence.criteria.CriteriaQuery;
import java.util.List;
import mate.academy.bookstore.exception.DataProcessingException;
import mate.academy.bookstore.model.Book;
Expand Down Expand Up @@ -45,10 +44,7 @@ public Book save(Book book) {
@Override
public List<Book> findAll() {
try (Session session = sessionFactory.openSession()) {
CriteriaQuery<Book> criteriaQuery = session
.getCriteriaBuilder().createQuery(Book.class);
criteriaQuery.from(Book.class);
return session.createQuery(criteriaQuery).getResultList();
return session.createQuery("FROM Book", Book.class).getResultList();
} catch (Exception e) {
throw new DataProcessingException("Can't find all books", e);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ spring.datasource.username=root
spring.datasource.password=password
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
Loading