Merge pull request #5267 from eugenp/spring-jpa-fix

fix spring-jpa start
This commit is contained in:
Loredana Crusoveanu 2018-09-16 20:00:30 +03:00 committed by GitHub
commit 5e3eb4ae41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 20 deletions

View File

@ -78,9 +78,9 @@ public class PersistenceJPAConfig {
final Properties hibernateProperties = new Properties();
hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto"));
hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect"));
hibernateProperties.setProperty("hibernate.cache.use_second_level_cache", env.getProperty("hibernate.cache.use_second_level_cache"));
hibernateProperties.setProperty("hibernate.cache.use_query_cache", env.getProperty("hibernate.cache.use_query_cache"));
// hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true");
hibernateProperties.setProperty("hibernate.cache.use_second_level_cache", "false");
return hibernateProperties;
}

View File

@ -5,7 +5,7 @@ import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatche
public class WebInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class[] { PersistenceJNDIConfig.class };
return new Class[] { PersistenceJPAConfig.class };
}
@Override

View File

@ -1,6 +1,6 @@
package org.baeldung.persistence.criteria.repository;
package org.baeldung.persistence.dao;
import org.baeldung.persistence.criteria.model.Book;
import org.baeldung.persistence.model.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

View File

@ -1,8 +1,8 @@
package org.baeldung.persistence.criteria.repository;
package org.baeldung.persistence.dao;
import java.util.List;
import org.baeldung.persistence.criteria.model.Book;
import org.baeldung.persistence.model.Book;
public interface BookRepositoryCustom {

View File

@ -1,4 +1,4 @@
package org.baeldung.persistence.criteria.dao;
package org.baeldung.persistence.dao;
import java.util.ArrayList;
import java.util.List;
@ -10,8 +10,7 @@ import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import org.baeldung.persistence.criteria.model.Book;
import org.baeldung.persistence.criteria.repository.BookRepositoryCustom;
import org.baeldung.persistence.model.Book;
import org.springframework.stereotype.Repository;
@Repository

View File

@ -1,12 +1,12 @@
package org.baeldung.persistence.criteria.repository;
package org.baeldung.persistence.dao;
import static org.baeldung.persistence.criteria.repository.BookSpecifications.hasAuthor;
import static org.baeldung.persistence.criteria.repository.BookSpecifications.titleContains;
import static org.baeldung.persistence.dao.BookSpecifications.hasAuthor;
import static org.baeldung.persistence.dao.BookSpecifications.titleContains;
import static org.springframework.data.jpa.domain.Specifications.where;
import java.util.List;
import org.baeldung.persistence.criteria.model.Book;
import org.baeldung.persistence.model.Book;
import org.springframework.stereotype.Service;
@Service

View File

@ -1,6 +1,6 @@
package org.baeldung.persistence.criteria.repository;
package org.baeldung.persistence.dao;
import org.baeldung.persistence.criteria.model.Book;
import org.baeldung.persistence.model.Book;
import org.springframework.data.jpa.domain.Specification;
public class BookSpecifications {

View File

@ -1,4 +1,4 @@
package org.baeldung.persistence.criteria.model;
package org.baeldung.persistence.model;
import javax.persistence.Entity;
import javax.persistence.Id;

View File

@ -21,8 +21,6 @@
<props>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
</props>
</property>
</bean>