mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-21 21:57:56 +01:00
Clean up jpa setting.
This commit is contained in:
parent
f86f96a35e
commit
7724d9106d
@ -131,11 +131,6 @@
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<version>8.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.angus</groupId>
|
||||
<artifactId>jakarta.mail</artifactId>
|
||||
@ -153,6 +148,13 @@
|
||||
<version>1.7</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Connection Pool-->
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
<version>5.1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Only for test purposes -->
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.context.annotation.Import;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@ComponentScan(basePackageClasses = {AuthenticationProvider.class, MindmapServiceImpl.class, LabelManagerImpl.class, VelocityEngineUtils.class})
|
||||
@Import({HibernateConfig.class, SecurityConfig.class})
|
||||
@Import({JPAConfig.class, SecurityConfig.class})
|
||||
@EnableAutoConfiguration
|
||||
@ImportResource(value = {"classpath:spring/wisemapping-mail.xml"})
|
||||
public class CommonConfig {
|
||||
|
@ -1,53 +0,0 @@
|
||||
package com.wisemapping.config.common;
|
||||
|
||||
import com.wisemapping.dao.MindmapManagerImpl;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.service.MindmapServiceImpl;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableJpaRepositories(basePackageClasses={MindmapServiceImpl.class, MindmapManagerImpl.class})
|
||||
@EntityScan(basePackageClasses= User.class)
|
||||
public class HibernateConfig {
|
||||
|
||||
// @Bean
|
||||
// public HibernateTransactionManager hibernateTransactionManager() {
|
||||
// final HibernateTransactionManager result = new HibernateTransactionManager();
|
||||
// result.setNestedTransactionAllowed(true);
|
||||
// // @Todo: Am I creatting two instances ???
|
||||
// result.setSessionFactory(sessionFactory().getObject());
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// private Properties hibernateProperties() {
|
||||
// final Properties result = new Properties();
|
||||
// result.setProperty("hibernate.dialect", dbDialect);
|
||||
// result.setProperty("hibernate.default_batch_fetch_size", "200");
|
||||
// result.setProperty("hibernate.nestedTransactionAllowed", "true");
|
||||
// result.setProperty("hibernate.auto_quote_keyword", "true");
|
||||
//
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// @Bean
|
||||
// public DataSource dataSource() {
|
||||
// final BasicDataSource result = new BasicDataSource();
|
||||
// result.setDriverClassName(dbDriver);
|
||||
// result.setUrl(dbUrl);
|
||||
// result.setUsername(dbUsername);
|
||||
// result.setPassword(dbPassword);
|
||||
// result.setTestOnBorrow(dbSetOnBorrow);
|
||||
//
|
||||
// result.setDefaultQueryTimeout(15);
|
||||
// result.setMaxTotal(100);
|
||||
// result.setMaxIdle(30);
|
||||
// result.setInitialSize(5);
|
||||
// result.setMaxWaitMillis(10000);
|
||||
// result.setValidationQuery(dbValQuery);
|
||||
//
|
||||
// return result;
|
||||
// }
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.wisemapping.config.common;
|
||||
|
||||
import com.wisemapping.dao.MindmapManagerImpl;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.service.MindmapServiceImpl;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableJpaRepositories(basePackageClasses={MindmapServiceImpl.class, MindmapManagerImpl.class})
|
||||
@EntityScan(basePackageClasses= User.class)
|
||||
public class JPAConfig {
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
##################################################################################
|
||||
SpringBoot Common
|
||||
SpringBoot DataSource
|
||||
##################################################################################
|
||||
|
||||
# JPA
|
||||
@ -11,9 +11,22 @@ spring.jpa.properties.hibernate.format_sql=true
|
||||
spring.sql.init.mode=always
|
||||
spring.sql.init.platform=hsqldb
|
||||
|
||||
# LOG
|
||||
logging.level.root=INFO
|
||||
logging.level.org.apache.tomcat=INFO
|
||||
spring.jpa.properties.hibernate.default_batch_fetch_size=200
|
||||
#spring.jpa.properties.hibernate.auto_quote_keyword=true
|
||||
|
||||
|
||||
# Connection pool (https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html#application-properties.data.spring.datasource.hikari)
|
||||
#spring.datasource.hikari.connection-test-query=
|
||||
#spring.datasource.hikari.connection-timeout=
|
||||
|
||||
# Embed Datasource Configuration
|
||||
database.base.url=/Users/veigap/
|
||||
spring.datasource.url=jdbc:hsqldb:file:${database.base.url}/db/wisemapping
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=
|
||||
|
||||
spring.datasource.driver-class-name = org.hsqldb.jdbc.JDBCDriver
|
||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.HSQLDialect
|
||||
|
||||
##################################################################################
|
||||
# Mail configuration. Must be configured to enable user registration confirmation.
|
||||
@ -119,15 +132,6 @@ security.oauth2.google.url=https//review
|
||||
#accounts.exclusion.domain=
|
||||
|
||||
|
||||
##################################################################################
|
||||
# Database Configuration
|
||||
##################################################################################
|
||||
|
||||
|
||||
database.base.url=/Users/veigap/
|
||||
spring.datasource.url=jdbc:hsqldb:file:${database.base.url}/db/wisemapping
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=
|
||||
|
||||
spring.datasource.driver-class-name = org.hsqldb.jdbc.JDBCDriver
|
||||
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.HSQLDialect
|
||||
# LOG
|
||||
logging.level.root=INFO
|
||||
logging.level.org.apache.tomcat=INFO
|
||||
|
Loading…
Reference in New Issue
Block a user