Skip to content

[BE] Spring boot ๋ฒ„์ „

kyY00n edited this page Aug 17, 2023 · 1 revision

Spring Boot 3.1.X


22๋…„ 11์›”์— Spring Boot 3.x๋ฒ„์ „์ด ๊ณต์‹์ ์œผ๋กœ ๋ฆด๋ฆฌ์ฆˆ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ง‘์‚ฌ์˜๊ณ ๋ฏผํŒ€์€ 3.1.1๋ฒ„์ „์„ ์‚ฌ์šฉํ•˜๊ธฐ๋กœ ํ–ˆ๋Š”๋ฐ์š”, ๊ทธ ๊ทผ๊ฑฐ๊ฐ€ ๊ฝค๋‚˜ ํ˜„์‹ค์ ์ด์—ˆ์Šต๋‹ˆ๋‹ค.

End of Support


image

์œ„ ์‚ฌ์ง„์„ ๋ณด๋ฉด Spring Boot 2.x๋Œ€์˜ ๊ฐ€์žฅ ์ตœ์‹  ๋ฒ„์ „์ธ Spring Boot 2.7๋ฒ„์ „๋Œ€์˜ ์ง€์›๊ธฐ๊ฐ„์ด 23๋…„ 11์›” 18์ผ๊นŒ์ง€์ž…๋‹ˆ๋‹ค. ๋‹น์žฅ ์šฐ์•„ํ•œํ…Œํฌ์ฝ”์Šค๋ฅผ ์ˆ˜๋ฃŒํ•˜๊ธฐ ์ „์— Spring Boot์—์„œ ๊ณต์‹์ ์œผ๋กœ ์ง€์›์„ ์ข…๋ฃŒํ•  ์ˆ˜๋„ ์žˆ๋‹ค๋Š” ์ด์•ผ๊ธฐ์ž…๋‹ˆ๋‹ค.

๋ฐ˜๋ฉด, 3.1 ๋ฒ„์ „๋Œ€์˜ ๊ฒฝ์šฐ ์ง€์› ๊ธฐ๊ฐ„์ด 2024๋…„ 5์›” 18์ผ๊นŒ์ง€ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. ๋ฌผ๋ก  3.2 ๋ฒ„์ „๋Œ€์˜ ์ง€์›๊ธฐ๊ฐ„์ด ๊ฐ€์žฅ ๊ธธ์ง€๋งŒ, ํ•ด๋‹น ๋ฒ„์ „์ด ์ •์‹ ๋ฆด๋ฆฌ์ฆˆ๋˜์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์— ๋…ผ์™ธ๋กœ ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค.

JPA


JPA๋Š” ์ž๋ฐ” ์ง„์˜์—์„œ ORM ๊ธฐ์ˆ  ํ‘œ์ค€์œผ๋กœ ์‚ฌ์šฉ๋˜๋Š” ์ธํ„ฐํŽ˜์ด์Šค ๋ชจ์Œ์ž…๋‹ˆ๋‹ค. JPA๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์ด์œ ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๊ฐ์ฒด์ง€ํ–ฅ๊ณผ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์‚ฌ์ด์˜ ํŒจ๋Ÿฌ๋‹ค์ž„ ๋ถˆ์ผ์น˜ ํ•ด๊ฒฐ


๊ธฐ์กด ์ž๋ฐ” ์ง„์˜์—์„œ ๊ฐœ๋ฐœํ•  ๋•Œ SQL์„ ์‚ฌ์šฉํ•˜๋Š” ๋ถ€๋ถ„์—์„œ ๊ฐ์ฒด์ง€ํ–ฅ๊ณผ SQL์˜ ํŒจ๋Ÿฌ๋‹ค์ž„์˜ ๋ถˆ์ผ์น˜๊ฐ€ ์ผ์–ด๋‚ฌ๋Š”๋ฐ, JPA๋Š” ๋ง๋”ํ•˜๊ฒŒ ํ•ด๊ฒฐํ•ด ์ค„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

image

์ƒ์‚ฐ์„ฑ ์ฆ๊ฐ€


JPA๋Š” DDL, DML(query method ์‚ฌ์šฉ ์‹œ) ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•ด์ค๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋งค์šฐ ๊ฐ„๋‹จํ•œ ๋ฉ”์„œ๋“œ๋กœ๋„ ํ•ด๋‹น ๋„๋ฉ”์ธ์˜ CRUD๊ฐ€ ๋ชจ๋‘ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ SQL์„ ์ž‘์„ฑํ•˜๊ณ  JDBC API๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐ˜๋ณต์ ์ธ ์ผ์„ ๋Œ€์‹  ์ฒ˜๋ฆฌํ•ด์ค๋‹ˆ๋‹ค.

@NoRepositoryBean
public interface JpaRepository<T, ID> extends ListCrudRepository<T, ID>, ListPagingAndSortingRepository<T, ID>, QueryByExampleExecutor<T> {
	void flush();
	<S extends T> S saveAndFlush(S entity);
	<S extends T> List<S> saveAllAndFlush(Iterable<S> entities);

	void deleteAllInBatch(Iterable<T> entities);
	void deleteAllByIdInBatch(Iterable<ID> ids);
	void deleteAllInBatch();

	T getReferenceById(ID id);

	@Override
	<S extends T> List<S> findAll(Example<S> example);
	@Override
	<S extends T> List<S> findAll(Example<S> example, Sort sort);
        ...
}

๐Ÿ• ์ง‘์‚ฌ์˜๊ณ ๋ฏผ

  1. ์ง‘์‚ฌ์˜ ๊ณ ๋ฏผ ์„œ๋น„์Šค ์†Œ๊ฐœ
  2. ์‚ฌ์šฉ์ž ์Šคํ† ๋ฆฌ ๋ฐ ๊ธฐ๋Šฅ๋ช…์„ธ
  3. ํŒ€ ๊ทธ๋ผ์šด๋“œ ๋ฃฐ
  4. Git Branch ์ „๋žต ๋ฐ Git Commit ์ปจ๋ฒค์…˜
  5. ์ง‘์‚ฌ์˜ ๊ณ ๋ฏผ ๋ฐฐํฌ ์ž๋™ํ™” ํŒŒ์ดํ”„๋ผ์ธ

Team Zipgo

  1. ํ‚ฅ์˜คํ”„ ๋ฏธํŒ… - ์šฐ๋ฆฌ์˜ ์‹œ์ž‘!
  2. ๋‚˜ ์‚ฌ์šฉ์„ค๋ช…์„œ
  3. 5์ฐจ ๋ฐ๋ชจ ํ˜‘์—… ๊ฒฝํ—˜ ๊ณต์œ 

ํ”„๋ก ํŠธ์—”๋“œ

๋ฐฑ์—”๋“œ

Clone this wiki locally