<aside> <img src="https://raw.githubusercontent.com/eirikmadland/notion-icons/master/v5/icon3/ul-github.svg" alt="https://raw.githubusercontent.com/eirikmadland/notion-icons/master/v5/icon3/ul-github.svg" width="40px" /> ์ฐธ์กฐ Github Code

</aside>

SPRING PROJECT์—์„œ IN-memory H2 ์‚ฌ์šฉ ์„ค์ • ๋ฐฉ๋ฒ•

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-03-09 แ„‹แ…ฉแ„’แ…ฎ 6.15.04.png

  1. build.gradle ์—์„œ ์œ„ ํ™”๋ฉด์ฒ˜๋Ÿผ ์ถ”๊ฐ€ ํ•„์š”
dependencies {
	runtimeOnly 'com.h2database:h2'
}
  1. application.yml์— ํ•ด๋‹น ๋‚ด์šฉ ์ถ”๊ฐ€
spring:
  h2:
    console:
      enabled: true
  1. SPRING ์„œ๋ฒ„ START ์ด ํ›„ http://localhost:8080/h2-console/ ์ฃผ์†Œ๋กœ ์ ‘์† ๋ฐ

    ์บก์ณ์˜ ๋ฉ”๋ชจ๋ฆฌ ์ ‘๊ทผ ์ฃผ์†Œ ํ™•์ธ ๋ฐ JDBC URL์— ์ž…๋ ฅ ์ดํ›„ ์ ‘์†

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-03-09 แ„‹แ…ฉแ„’แ…ฎ 6.27.50.png

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-03-09 แ„‹แ…ฉแ„’แ…ฎ 6.29.52.png

แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2022-03-09 แ„‹แ…ฉแ„’แ…ฎ 6.31.24.png

๋กœ์ปฌ ์„œ๋ฒ„๋ฅผ ์žฌ์‹œ์ž‘ํ•˜๋ฉด ์ƒˆ๋กœ์šด ๋ฉ”๋ชจ๋ฆฌ ์ฃผ์†Œ๋กœ ์ ‘์†์ด ๊ฐ€๋Šฅํ•˜๋‹ค.

Entity ์ž‘์„ฑ

  1. Developer
@Setter
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@EntityListeners(AuditingEntityListener.class)
public class Developer {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    protected Long id;

    @Enumerated(EnumType.STRING)
    private DeveloperLevel developerLevel;

    @Enumerated(EnumType.STRING)
    private DeveloperSkillType developerSkillType;

    private Integer experienceYear;
    private String memberId;
    private String name;
    private Integer age;

    @CreatedDate
    private LocalDateTime createdAt;

    @LastModifiedDate
    private LocalDateTime updatedAt;
}
  1. DeveloperLevel