diff --git a/ax-boot-admin/pom.xml b/ax-boot-admin/pom.xml
index fbb52fcb..3b5627b9 100644
--- a/ax-boot-admin/pom.xml
+++ b/ax-boot-admin/pom.xml
@@ -12,14 +12,14 @@
com.chequer.axboot
ax-boot-framework
- 2.1.4
+ 2.2.0
com.chequer.axboot
ax-boot-core
- 2.1.38
+ 2.2.0
diff --git a/ax-boot-admin/src/main/java/com/chequer/axboot/admin/AXBootApplicationInitializer.java b/ax-boot-admin/src/main/java/com/chequer/axboot/admin/AXBootApplicationInitializer.java
index ae256d1d..895cf9bb 100644
--- a/ax-boot-admin/src/main/java/com/chequer/axboot/admin/AXBootApplicationInitializer.java
+++ b/ax-boot-admin/src/main/java/com/chequer/axboot/admin/AXBootApplicationInitializer.java
@@ -2,20 +2,18 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.web.support.SpringBootServletInitializer;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Configuration;
@Configuration
public class AXBootApplicationInitializer extends SpringBootServletInitializer {
- public static final Object[] APPLICATION_SOURCES = new Object[]{AXBootApplication.class};
-
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
- return application.sources(APPLICATION_SOURCES);
+ return application.sources(AXBootApplication.class);
}
public static void main(String[] args) {
- SpringApplication.run(APPLICATION_SOURCES, args);
+ SpringApplication.run(AXBootApplication.class, args);
}
}
diff --git a/ax-boot-admin/src/main/java/com/chequer/axboot/admin/domain/user/UserService.java b/ax-boot-admin/src/main/java/com/chequer/axboot/admin/domain/user/UserService.java
index fb9ce7d5..555b726f 100644
--- a/ax-boot-admin/src/main/java/com/chequer/axboot/admin/domain/user/UserService.java
+++ b/ax-boot-admin/src/main/java/com/chequer/axboot/admin/domain/user/UserService.java
@@ -45,7 +45,7 @@ public void saveUser(List users) throws Exception {
delete(qUserAuth).where(qUserAuth.userCd.eq(user.getUserCd())).execute();
String password = bCryptPasswordEncoder.encode(user.getUserPs());
- User originalUser = userRepository.findOne(user.getUserCd());
+ User originalUser = userRepository.findById(user.getUserCd()).orElse(null);
if (originalUser != null) {
if (isNotEmpty(user.getUserPs())) {
diff --git a/ax-boot-core/pom.xml b/ax-boot-core/pom.xml
index 835d3853..53def8dc 100644
--- a/ax-boot-core/pom.xml
+++ b/ax-boot-core/pom.xml
@@ -4,7 +4,7 @@
ax-boot-core
AX Boot Core
AX Boot Core
- 2.1.38
+ 2.2.0
http://www.axboot.com
jar
4.0.0
@@ -12,7 +12,7 @@
com.chequer.axboot
ax-boot-framework
- 2.1.4
+ 2.2.0
diff --git a/ax-boot-core/src/main/java/com/chequer/axboot/core/db/schema/SchemaGenerator.java b/ax-boot-core/src/main/java/com/chequer/axboot/core/db/schema/SchemaGenerator.java
index fc86413a..66e430e7 100644
--- a/ax-boot-core/src/main/java/com/chequer/axboot/core/db/schema/SchemaGenerator.java
+++ b/ax-boot-core/src/main/java/com/chequer/axboot/core/db/schema/SchemaGenerator.java
@@ -1,15 +1,19 @@
package com.chequer.axboot.core.db.schema;
import com.chequer.axboot.core.annotations.ColumnPosition;
+
+import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
-import org.hibernate.boot.spi.MetadataImplementor;
+import org.hibernate.cfg.ImprovedNamingStrategy;
import org.hibernate.tool.hbm2ddl.SchemaExport;
-import org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy;
+import org.hibernate.tool.schema.TargetType;
import org.springframework.stereotype.Component;
import javax.persistence.Column;
import javax.persistence.Transient;
+
+import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.lang.reflect.Field;
@@ -21,17 +25,12 @@
public class SchemaGenerator extends SchemaGeneratorBase {
public void createSchema() throws IOException, ClassNotFoundException {
- SchemaExport export = new SchemaExport((MetadataImplementor) getMetaData());
String scriptOutputPath = System.getProperty("java.io.tmpdir") + "/schema.sql";
- /*
- SchemaExport schemaExport = new SchemaExport();
FileUtils.deleteQuietly(new File(scriptOutputPath));
- EnumSet targetTypes = EnumSet.of(TargetType.SCRIPT);
+
+ SchemaExport schemaExport = new SchemaExport();
schemaExport.setOutputFile(scriptOutputPath);
- schemaExport.createOnly(targetTypes, getMetaData());
- */
- export.setOutputFile(scriptOutputPath);
- export.create(true, true);
+ schemaExport.createOnly(EnumSet.of(TargetType.SCRIPT), getMetaData());
List DDLs = IOUtils.readLines(new FileInputStream(scriptOutputPath), "UTF-8");
List convertedDDLs = new ArrayList<>();
@@ -119,7 +118,7 @@ public void setPosition(Field field, List columnDefinitions) {
if (column != null && !"".equals(column.name())) {
columnName = column.name();
} else {
- columnName = new SpringNamingStrategy().columnName(name);
+ columnName = new ImprovedNamingStrategy().columnName(name);
}
if (columnPosition != null && columnPosition.value() > 0) {
diff --git a/ax-boot-core/src/main/java/com/chequer/axboot/core/db/schema/SchemaGeneratorBase.java b/ax-boot-core/src/main/java/com/chequer/axboot/core/db/schema/SchemaGeneratorBase.java
index 3c5649e1..2d1f9b11 100644
--- a/ax-boot-core/src/main/java/com/chequer/axboot/core/db/schema/SchemaGeneratorBase.java
+++ b/ax-boot-core/src/main/java/com/chequer/axboot/core/db/schema/SchemaGeneratorBase.java
@@ -1,8 +1,17 @@
package com.chequer.axboot.core.db.schema;
-import com.chequer.axboot.core.config.AXBootContextConfig;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.stream.Collectors;
+
+import javax.persistence.Entity;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Table;
+
+import org.apache.commons.lang3.StringUtils;
import org.hibernate.Session;
-import org.hibernate.SessionFactory;
import org.hibernate.boot.Metadata;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.BootstrapServiceRegistry;
@@ -10,23 +19,13 @@
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.internal.SessionFactoryImpl;
-import org.hibernate.metadata.ClassMetadata;
import org.reflections.Reflections;
-import org.reflections.util.ClasspathHelper;
-import org.reflections.util.ConfigurationBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
-import javax.persistence.Entity;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Table;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
+import com.chequer.axboot.core.config.AXBootContextConfig;
public class SchemaGeneratorBase {
@@ -48,6 +47,16 @@ public class SchemaGeneratorBase {
@Autowired
private AXBootContextConfig axBootContextConfig;
+ /**
+ * key : TableName
+ * value: EntityClass
+ */
+ private Map> tableNameEntityClassMap;
+
+ public SchemaGeneratorBase() {
+ tableNameEntityClassMap = getTableNameEntityClassMap();
+ }
+
protected SessionFactoryImpl getSessionFactory() {
Session session = (Session) entityManager.getDelegate();
return (SessionFactoryImpl) session.getSessionFactory();
@@ -77,61 +86,32 @@ protected Metadata getMetaData() {
return metadataSources.buildMetadata();
}
- public List getTableList() {
- List tableName = new ArrayList();
-
- new Reflections()
- .getTypesAnnotatedWith(Entity.class)
- .forEach(clazz -> {
- if (clazz.isAnnotationPresent(Table.class)) {
- tableName.add(clazz.getAnnotation(Table.class).name());
- }
- });
+ public Map> getTableNameEntityClassMap() {
+ return new Reflections()
+ .getTypesAnnotatedWith(Entity.class)
+ .stream()
+ .filter(clazz -> clazz.isAnnotationPresent(Table.class))
+ .collect(Collectors.toMap(
+ clazz -> clazz.getAnnotation(Table.class).name(),
+ clazz -> clazz
+ ));
+ }
- return tableName;
+ public List getTableList() {
+ return tableNameEntityClassMap.values().stream()
+ .map(entity -> entity.getAnnotation(Table.class).name())
+ .collect(Collectors.toList());
}
- protected String getEntityClassName(String tableName) {
- SessionFactory sessionFactory = entityManagerFactory.unwrap(SessionFactory.class);
- //Set> entities = sessionFactory.getMetamodel().getEntities();
-
- Map classMetadataMap = sessionFactory.getAllClassMetadata();
-
- for (String key : classMetadataMap.keySet()) {
- try {
- Class> entityClass = Class.forName(key);
-
- if (entityClass.isAnnotationPresent(Table.class)) {
- String entityTableName = entityClass.getAnnotation(Table.class).name();
- if (entityTableName.toLowerCase().equals(tableName.toLowerCase())) {
- return entityClass.getName();
- }
- } else {
- if (entityClass.getName().equals(tableName)) {
- return entityClass.getName();
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
+ protected String getEntityClassName(final String tableName) {
+ if (tableNameEntityClassMap.containsKey(tableName)) {
+ return tableNameEntityClassMap.get(tableName).getName();
}
- /*
- for (EntityType> entityType : entities) {
- Class> entityClass = entityType.getJavaType();
-
- if (entityClass.isAnnotationPresent(Table.class)) {
- String entityTableName = entityClass.getAnnotation(Table.class).name();
- if (entityTableName.toLowerCase().equals(tableName.toLowerCase())) {
- return entityClass.getName();
- }
- } else {
- if (entityClass.getName().equals(tableName)) {
- return entityClass.getName();
- }
- }
- }
- */
- return null;
+ return tableNameEntityClassMap.values().stream()
+ .filter(clazz -> StringUtils.equals(clazz.getName(), tableName))
+ .map(Class::getName)
+ .findFirst()
+ .orElse(null);
}
}
diff --git a/ax-boot-core/src/main/java/com/chequer/axboot/core/db/type/LabelEnumType.java b/ax-boot-core/src/main/java/com/chequer/axboot/core/db/type/LabelEnumType.java
index 3527de40..8fad27b7 100644
--- a/ax-boot-core/src/main/java/com/chequer/axboot/core/db/type/LabelEnumType.java
+++ b/ax-boot-core/src/main/java/com/chequer/axboot/core/db/type/LabelEnumType.java
@@ -2,7 +2,7 @@
import com.chequer.axboot.core.code.LabelEnum;
import org.hibernate.HibernateException;
-import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.usertype.DynamicParameterizedType;
import org.hibernate.usertype.UserType;
@@ -49,7 +49,7 @@ public boolean isMutable() {
}
@Override
- public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor sharedSessionContractImplementor, Object o) throws HibernateException, SQLException {
+ public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor sharedSessionContractImplementor, Object o) throws HibernateException, SQLException {
String label = rs.getString(names[0]);
if (rs.wasNull()) {
return null;
@@ -66,7 +66,7 @@ public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor share
}
@Override
- public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor sharedSessionContractImplementor) throws HibernateException, SQLException {
+ public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor sharedSessionContractImplementor) throws HibernateException, SQLException {
if (value == null) {
st.setNull(index, Types.VARCHAR);
} else {
diff --git a/ax-boot-core/src/main/java/com/chequer/axboot/core/db/type/MySQLJSONUserType.java b/ax-boot-core/src/main/java/com/chequer/axboot/core/db/type/MySQLJSONUserType.java
index f3f86a12..6bd2e731 100644
--- a/ax-boot-core/src/main/java/com/chequer/axboot/core/db/type/MySQLJSONUserType.java
+++ b/ax-boot-core/src/main/java/com/chequer/axboot/core/db/type/MySQLJSONUserType.java
@@ -5,7 +5,7 @@
import org.hibernate.HibernateException;
import org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl;
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
-import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.type.SerializationException;
import org.hibernate.usertype.ParameterizedType;
import org.hibernate.usertype.UserType;
@@ -40,7 +40,7 @@ public int[] sqlTypes() {
}
@Override
- public Object nullSafeGet(ResultSet resultSet, String[] names, SessionImplementor sharedSessionContractImplementor, Object o) throws HibernateException, SQLException {
+ public Object nullSafeGet(ResultSet resultSet, String[] names, SharedSessionContractImplementor sharedSessionContractImplementor, Object o) throws HibernateException, SQLException {
try {
if (resultSet.getBytes(names[0]) != null) {
final String json = new String(resultSet.getBytes(names[0]), "UTF-8");
@@ -53,7 +53,7 @@ public Object nullSafeGet(ResultSet resultSet, String[] names, SessionImplemento
}
@Override
- public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor sharedSessionContractImplementor) throws HibernateException, SQLException {
+ public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor sharedSessionContractImplementor) throws HibernateException, SQLException {
try {
final String json = value == null ? null : objectMapper.writeValueAsString(value);
st.setObject(index, json);
diff --git a/ax-boot-core/src/main/java/com/chequer/axboot/core/domain/base/AXBootBaseService.java b/ax-boot-core/src/main/java/com/chequer/axboot/core/domain/base/AXBootBaseService.java
index e6407f09..4aaf1f81 100644
--- a/ax-boot-core/src/main/java/com/chequer/axboot/core/domain/base/AXBootBaseService.java
+++ b/ax-boot-core/src/main/java/com/chequer/axboot/core/domain/base/AXBootBaseService.java
@@ -52,11 +52,11 @@ public Page findAll(Pageable pageable, String searchParams) {
}
public List findAll(Iterable iterable) {
- return repository.findAll(iterable);
+ return repository.findAllById(iterable);
}
public T findOne(Predicate predicate) {
- return repository.findOne(predicate);
+ return repository.findOne(predicate).orElse(null);
}
public List findAll(Predicate predicate) {
@@ -155,11 +155,11 @@ public Collection save(Collection vars) {
}
public T findOne(ID var1) {
- return repository.findOne(var1);
+ return repository.findById(var1).orElse(null);
}
public boolean exists(ID var1) {
- return repository.exists(var1);
+ return repository.existsById(var1);
}
public long count() {
@@ -168,7 +168,7 @@ public long count() {
@Transactional
public void delete(ID var1) {
- repository.delete(var1);
+ repository.deleteById(var1);
}
@Transactional
@@ -178,7 +178,7 @@ public void delete(T var1) {
@Transactional
public void delete(Iterable extends T> var1) {
- repository.delete(var1);
+ repository.deleteAll(var1);
}
@Transactional
diff --git a/ax-boot-core/src/main/java/com/chequer/axboot/core/domain/base/AXBootJPAQueryDSLRepository.java b/ax-boot-core/src/main/java/com/chequer/axboot/core/domain/base/AXBootJPAQueryDSLRepository.java
index 77938fcf..f9511627 100644
--- a/ax-boot-core/src/main/java/com/chequer/axboot/core/domain/base/AXBootJPAQueryDSLRepository.java
+++ b/ax-boot-core/src/main/java/com/chequer/axboot/core/domain/base/AXBootJPAQueryDSLRepository.java
@@ -1,11 +1,11 @@
package com.chequer.axboot.core.domain.base;
import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.querydsl.QueryDslPredicateExecutor;
+import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.data.repository.NoRepositoryBean;
import java.io.Serializable;
@NoRepositoryBean
-public interface AXBootJPAQueryDSLRepository extends JpaRepository, QueryDslPredicateExecutor {
+public interface AXBootJPAQueryDSLRepository extends JpaRepository, QuerydslPredicateExecutor {
}
diff --git a/ax-boot-initialzr/pom.xml b/ax-boot-initialzr/pom.xml
index 060f2ca0..359018a3 100644
--- a/ax-boot-initialzr/pom.xml
+++ b/ax-boot-initialzr/pom.xml
@@ -12,14 +12,14 @@
ax-boot-framework
com.chequer.axboot
- 2.1.4
+ 2.2.0
com.chequer.axboot
ax-boot-core
- 2.1.38
+ 2.2.0
diff --git a/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/AXBootInitialzrApplication.java b/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/AXBootInitialzrApplication.java
index bfd10a25..40129310 100644
--- a/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/AXBootInitialzrApplication.java
+++ b/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/AXBootInitialzrApplication.java
@@ -4,7 +4,7 @@
import com.chequer.axboot.core.config.AXBootContextConfig;
import com.chequer.axboot.core.model.extract.service.jdbc.JdbcMetadataService;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
+import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
diff --git a/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/AXBootInitialzrApplicationInitializer.java b/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/AXBootInitialzrApplicationInitializer.java
index 3e20fd68..e82ca11c 100644
--- a/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/AXBootInitialzrApplicationInitializer.java
+++ b/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/AXBootInitialzrApplicationInitializer.java
@@ -1,24 +1,21 @@
package com.chequer.axboot.initialzr;
-import com.chequer.axboot.core.AXBootCoreConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.web.support.SpringBootServletInitializer;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.WebApplicationInitializer;
@Configuration
public class AXBootInitialzrApplicationInitializer extends SpringBootServletInitializer implements WebApplicationInitializer {
- public static final Object[] APPLICATION_SOURCES = new Object[]{AXBootInitialzrApplication.class};
-
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
this.setRegisterErrorPageFilter(false);
- return application.sources(APPLICATION_SOURCES);
+ return application.sources(AXBootInitialzrApplication.class);
}
public static void main(String[] args) {
- SpringApplication.run(APPLICATION_SOURCES, args);
+ SpringApplication.run(AXBootInitialzrApplication.class, args);
}
}
diff --git a/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/service/ProjectGenerator.java b/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/service/ProjectGenerator.java
index 908124fa..58a2b89b 100644
--- a/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/service/ProjectGenerator.java
+++ b/ax-boot-initialzr/src/main/java/com/chequer/axboot/initialzr/service/ProjectGenerator.java
@@ -17,6 +17,7 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@@ -37,51 +38,48 @@ public void generate(ProjectGenerateRequest projectGenerateRequest, HttpServletR
response.setHeader("Content-Disposition", "attachment; filename=" + encodedFileName);
response.setContentType("application/zip");
- ServletOutputStream outputStream = response.getOutputStream();
- ZipOutputStream zos = new ZipOutputStream(outputStream);
+ try (
+ ServletOutputStream outputStream = response.getOutputStream();
+ ZipOutputStream zos = new ZipOutputStream(outputStream)
+ ) {
+ Map values = new HashMap<>();
- Map values = new HashMap<>();
+ String uuid = UUID.randomUUID().toString();
- String uuid = UUID.randomUUID().toString();
+ values.put("package", packageName);
+ values.put("basePackage", packageName);
+ values.put("domainPackage", packageName + ".domain");
+ values.put("projectName", projectName);
+ values.put("artifactId", artifactId);
+ values.put("description", description);
+ values.put("groupId", groupId);
+ values.put("sessionCookie", uuid);
+ values.put("axbootCoreVersion", "2.2.0");
- values.put("package", packageName);
- values.put("basePackage", packageName);
- values.put("domainPackage", packageName + ".domain");
- values.put("projectName", projectName);
- values.put("artifactId", artifactId);
- values.put("description", description);
- values.put("groupId", groupId);
- values.put("sessionCookie", uuid);
- values.put("axbootCoreVersion", "2.1.38");
+ PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
- PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
+ Resource[] resources = resolver.getResources("/templates/**");
- Resource[] resources = resolver.getResources("/templates/**");
+ for (Resource resource : resources) {
+ File file = resource.getFile();
- for (Resource resource : resources) {
- File file = resource.getFile();
+ if (file.isFile()) {
+ byte[] bytes = getBytes(file, values);
+ String path = getPath(artifactId, packageName, file);
- if (file.isFile()) {
- byte[] bytes = getBytes(file, values);
- String path = getPath(artifactId, packageName, file);
-
- ZipEntry entry = new ZipEntry(path);
- entry.setSize(bytes.length);
- zos.putNextEntry(entry);
- zos.write(bytes);
+ ZipEntry entry = new ZipEntry(path);
+ entry.setSize(bytes.length);
+ zos.putNextEntry(entry);
+ zos.write(bytes);
+ }
}
}
-
- zos.closeEntry();
- IOUtils.closeQuietly(zos);
- outputStream.flush();
}
public String getPath(String projectName, String packageName, File file) {
String baseName = projectName + "/src/main";
- String substract = "/WEB-INF/classes/templates";
+ String substract = "/classes/templates";
- String name = FilenameUtils.getName(file.getName());
String ext = FilenameUtils.getExtension(file.getName()).toLowerCase();
String filePath = file.getAbsolutePath();
String path = filePath.substring(filePath.indexOf(substract) + substract.length());
@@ -98,7 +96,7 @@ public String getPath(String projectName, String packageName, File file) {
return baseName + path;
}
- public byte[] getBytes(File file, Map values) throws IOException {
+ private byte[] getBytes(File file, Map values) throws IOException {
String ext = FilenameUtils.getExtension(file.getName()).toLowerCase();
if (ext.equals("jsp") ||
@@ -117,7 +115,7 @@ public byte[] getBytes(File file, Map values) throws IOException
String template = FileUtils.readFileToString(file, "UTF-8");
template = strSubstitutor.replace(template);
- return template.getBytes("UTF-8");
+ return template.getBytes(StandardCharsets.UTF_8);
}
return IOUtils.toByteArray(new FileInputStream(file));
}
diff --git a/ax-boot-initialzr/src/main/resources/templates/java/AXBootApplicationInitializer.java b/ax-boot-initialzr/src/main/resources/templates/java/AXBootApplicationInitializer.java
index 694ec12f..9884f80a 100644
--- a/ax-boot-initialzr/src/main/resources/templates/java/AXBootApplicationInitializer.java
+++ b/ax-boot-initialzr/src/main/resources/templates/java/AXBootApplicationInitializer.java
@@ -2,20 +2,18 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.web.support.SpringBootServletInitializer;
+import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Configuration;
@Configuration
public class AXBootApplicationInitializer extends SpringBootServletInitializer {
- public static final Object[] APPLICATION_SOURCES = new Object[]{AXBootApplication.class};
-
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
- return application.sources(APPLICATION_SOURCES);
+ return application.sources(AXBootApplication.class);
}
public static void main(String[] args) {
- SpringApplication.run(APPLICATION_SOURCES, args);
+ SpringApplication.run(AXBootApplication.class, args);
}
}
diff --git a/ax-boot-initialzr/src/main/resources/templates/java/domain/user/UserService.java b/ax-boot-initialzr/src/main/resources/templates/java/domain/user/UserService.java
index bb7f4536..7a02e73e 100644
--- a/ax-boot-initialzr/src/main/resources/templates/java/domain/user/UserService.java
+++ b/ax-boot-initialzr/src/main/resources/templates/java/domain/user/UserService.java
@@ -45,7 +45,7 @@ public void saveUser(List users) throws Exception {
delete(qUserAuth).where(qUserAuth.userCd.eq(user.getUserCd())).execute();
String password = bCryptPasswordEncoder.encode(user.getUserPs());
- User originalUser = userRepository.findOne(user.getUserCd());
+ User originalUser = userRepository.findById(user.getUserCd()).orElse(null);
if (originalUser != null) {
if (isNotEmpty(user.getUserPs())) {
diff --git a/ax-boot-initialzr/src/main/resources/templates/root/pom.xml b/ax-boot-initialzr/src/main/resources/templates/root/pom.xml
index 6efce386..fb086383 100644
--- a/ax-boot-initialzr/src/main/resources/templates/root/pom.xml
+++ b/ax-boot-initialzr/src/main/resources/templates/root/pom.xml
@@ -38,7 +38,7 @@
com.chequer.axboot
ax-boot-framework
- 2.1.2
+ 2.2.0
diff --git a/pom.xml b/pom.xml
index 60829fe2..c6517bb7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
4.0.0
com.chequer.axboot
ax-boot-framework
- 2.1.4
+ 2.2.0
pom
AX Boot Parent
AX Boot Framework
@@ -15,7 +15,7 @@
org.springframework.boot
spring-boot-starter-parent
- 1.5.4.RELEASE
+ 2.1.4.RELEASE
@@ -157,8 +157,8 @@
4.4
2.0
4.1.4
+ 6.0.13.Final
- 1.5.1.RELEASE
2.7.1
1.1.1
1.0.2
@@ -527,6 +527,12 @@
${hibernate.version}
+
+ org.hibernate
+ hibernate-validator
+ ${hibernate.validator.version}
+
+