This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.apz.sample.mapper; | |
import org.dbunit.dataset.IDataSet; | |
import org.dbunit.dataset.csv.CsvDataSet; | |
import org.springframework.core.io.Resource; | |
import com.github.springtestdbunit.dataset.AbstractDataSetLoader; | |
public class CSVDataSetLoader extends AbstractDataSetLoader { | |
@Override | |
protected IDataSet createDataSet(Resource resource) throws Exception { | |
return new CsvDataSet(resource.getFile()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.apz.sample.mapper; | |
import static org.junit.Assert.*; | |
import org.junit.jupiter.api.Test; | |
import org.mybatis.spring.boot.test.autoconfigure.MybatisTest; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; | |
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase.Replace; | |
import org.springframework.test.context.TestExecutionListeners; | |
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener; | |
import org.springframework.test.context.support.DirtiesContextTestExecutionListener; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.apz.sample.mapper; | |
import java.util.List; | |
import org.apache.ibatis.annotations.Mapper; | |
import org.apache.ibatis.annotations.Param; | |
import com.github.apz.sample.record.Item; | |
@Mapper | |
public interface ItemMapper { | |
public List<Item> findById(@Param("id") String id); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.scheduling.annotation.Scheduled; | |
import org.springframework.stereotype.Service; | |
import com.github.apz.repository.TaskRepository; | |
import lombok.AllArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import net.javacrumbs.shedlock.core.SchedulerLock; | |
@Service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.scheduling.annotation.EnableScheduling; | |
import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock; | |
@SpringBootApplication | |
@EnableScheduling | |
// EnableSchedulerLockの属性値に指定する時間フォーマットはjava.time.Durationを利用。 | |
// https://en.wikipedia.org/wiki/ISO_8601#Durations | |
// MostForはロック時間の最長。LeastFor は ロック時間の最短。 | |
@EnableSchedulerLock(defaultLockAtMostFor = "PT5M", defaultLockAtLeastFor = "PT30S") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.scheduling.annotation.EnableScheduling; | |
@SpringBootApplication | |
@EnableScheduling | |
public class SchedulerSampleApplication { | |
public static void main(String[] args) { | |
SpringApplication.run(SchedulerSampleApplication.class, args); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja" | |
xmlns:th="http://www.thymeleaf.org" | |
xmlns:sec="http://www.thymeleaf.org/extras/spring-security"> | |
<head> | |
<title>削除画面</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<meta charset="UTF-8"/> | |
<link th:href="@{/css/common.css}" rel="stylesheet"/> | |
<link th:href="@{/webjars/bootstrap/4.6.0-1/css/bootstrap.min.css}" rel="stylesheet" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.servlet.ServletContext; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.web.context.ServletContextAware; | |
import org.springframework.web.servlet.LocaleResolver; | |
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; | |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | |
import org.springframework.web.servlet.i18n.CookieLocaleResolver; | |
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
*/ | |
package com.github.apz.struts2.sample.arrays.actions; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.struts2.convention.annotation.Action; | |
import org.apache.struts2.convention.annotation.ExceptionMapping; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.apz.config; | |
import java.util.Arrays; | |
import java.util.stream.Collectors; | |
import org.springframework.util.StringUtils; | |
public class TextArea { | |
final static String LINE_SEPARATOR = "\r\n"; |