@ExtendWith(SpringExtension.class)
@SpringBootTest(classes={TestConfig.class})
public class MybatisMapperNotFoundTest {
}
@MapperScan(value = {"org.example.infrastructure.*"})
public class TestConfig {- yml source 는 아래와 같습니다.
test:
first-level:
name: firstLevel
second-level:
name: secondLevel
This file contains hidden or 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
| # terminal 1, terminal 2 로 구분했습니다. | |
| terminal 1 > watch lockTest | |
| OK | |
| terminal 2> set lockTest 1 | |
| terminal 1> MULTI | |
| OK | |
| terminal 1> set lockTest 2 | |
| QUEUED |
This file contains hidden or 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
| 127.0.0.1:6379> MULTI | |
| OK | |
| 127.0.0.1:6379(TX)> set member1 testName | |
| QUEUED | |
| 127.0.0.1:6379(TX)> set member2 testName2 | |
| QUEUED | |
| 127.0.0.1:6379(TX)> EXEC | |
| 1) OK | |
| 2) OK | |
| 127.0.0.1:6379> GET member1 |
This file contains hidden or 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
| // WRITER SOURCE | |
| @Bean | |
| @StepScope // step 기간동안 빈 lifecycle 관리. | |
| public FlatFileItemWriter<FlatFileExampleInfo.Base> flatFileExampleWriter(@Value("#{jobParameters[path]}") String path) { | |
| if (StringUtils.isEmpty(path)) { | |
| throw new IllegalArgumentException("path is null"); | |
| } | |
| return new FlatFileItemWriterBuilder() |
This file contains hidden or 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
| // build.gradle | |
| buildscript { | |
| ext { | |
| springBootVersion = '2.4.5' | |
| querydslPluginVersion = '1.0.10' // 플러그인 버전 | |
| } | |
| repositories { | |
| maven { url "https://plugins.gradle.org/m2/" } // 플러그인 저장소 | |
| } |
This file contains hidden or 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
| @Repository | |
| @RequiredArgsConstructor | |
| public class MemberQueryRepository { | |
| private final JPAQueryFactory jpaQueryFactory; | |
| public Member findOneOrderByName() { | |
| List<Member> list = jpaQueryFactory | |
| .selectFrom(member) | |
| .orderBy(member.name.asc()) |
This file contains hidden or 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
| // Entity Member | |
| @Entity | |
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | |
| @Getter | |
| public class Member extends BaseTime { | |
| @Id | |
| @Column(name = "member_id") | |
| @GeneratedValue(strategy = GenerationType.AUTO) | |
| private Long id; |