일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 김영한
- springdatajpa
- jpa
- Greedy
- Spring Boot
- JDBC
- transaction
- SpringBoot
- Servlet
- http
- java
- 알고리즘
- 백준
- 스프링 핵심 원리
- 그리디
- kotlin
- 인프런
- 스프링 핵심 기능
- Exception
- Proxy
- Thymeleaf
- pointcut
- spring
- 스프링
- QueryDSL
- 자바
- Android
- JPQL
- db
- AOP
- Today
- Total
목록jpa (149)
개발자되기 프로젝트

Spring Data JPA사용하면 와..이게되네? Spring Data JPA는 JPA를 활용하기 쉽게 도와주는 라이브러리임. 핵심은 JPA라는것을 잊지 말자. 1. SpringDataMemberRepository interface 인터페이스를 하나 만들자! JpaRepository와 이전에 만들어둔 MemberRepository를 상속 받는다. public interface SpringDataJpaMemberRepository extends JpaRepository, MemberRepository{ @Override Optional findById(Long aLong); } 간단하게 선언하는 것으로 사용이 가능하다. 그리고 JpaRepository를 상속받는 인터페이서는 스프링 데이터 JPA가 구현체..

JPA를 사용하면 SQL까지 안적어도 된다! 객체를 JPA에 넣어주면 JPA가 중간에서 DB에 SQL날리고 data가져옴 SQL과 Data중심의 설계에서 객체 중심의 설계로 패터다임 전환 JPA 소개 1. ORM(Object Relational Mapping) 객체와 관계형 Database를 자동으로 mapping시켜주는 것을 말한다. 객체지향 프로그래밍의 기본 단위는 object 이고 관계형 Datebase의 기본단위는 table이다. 따라서 객.. bsh-developer.tistory.com 1. build.gradle JPA를 사용하기 위해서 dependency 추가가 필요하다.(jdbc는 지워주자) //implementation 'org.springframework.boot:spring-boot..

영화 리뷰 관리를 위해 필요한 필수 기능인 comment 기능을 추가해보자. 이미 필요 기능은 구현되어 있고, 프론트를 통해 실행시킬 수 있어야 한다. 1. 자바스크립트 기존에 작성되어있는, Vue객체인 movie_list 내부에 addComment function을 추가했다. 해당 fucntion은 commentBox의 content를 가져와서 Post method를 실행한다. 이후 성공시 전체 movie리스트를 불러와서 프론트를 업데이트한다. var movie_list = new Vue({ el: '#movie-list', data: { movie_list : {} }, methods: { deleteMovie: function (id) { $.ajax({ type: "DELETE" , async: ..

1. method실행 후 프론트에 반영이 안된다. ['21.07.19] DB에서 삭제하기 1. DB에서 삭제가 되지 않는다...에러 내용 리스트에서 삭제를 시도해도 되지 않는다. 아래와 같은 에러가 발생한다. .MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.. bsh-developer.tistory.com 앞선 글에서 말했다 시피, 삭제 버튼 클릭 시 DB에선 삭제가 되나, 프론트에서 표시가 안되는 문제가 있었다. 즉 결과적으로, delete method시행 후 프론트를 업데이트 하기위해 findAll이 실행되어야 하는데, 실행되지 않아 발생한 문제인 것 같다. 변경 전 코드를 보면 method spqndp ..

1. DB에서 삭제가 되지 않는다...에러 내용 리스트에서 삭제를 시도해도 되지 않는다. 아래와 같은 에러가 발생한다. .MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'int'; nested exception is java.lang.NumberFormatException: For input string: "undefined"] 에러의 원인은 int가 들어와야 하는데 String값인 "undefined"가 들어왔다. 크롬에서는 다음과 같은 에러가 발생한다. jquery.min.js:4 DELETE http://localhost:8080/api/delete/movie..

['21.07.18] 간단한 프론트 개발#1 기본적인 기능이 갖추어 졌으니, 간단한 프론트를 개발하여 연결해보자. 1. PageController 기존의 ApiController가 아닌 PageController를 만들어 주자. @Controller @RequestMapping("/movie/pages") public cla.. bsh-developer.tistory.com 앞선 글에서 말한 것 처럼, 이미지 크기가 너무 작았다. 따라서 영화 API를 통해 썸네일을 가져오는 것이 아니라 별도 이미지 검색을 해서 가져와보도록 하자. 전체적인 구성은 영화 검색 API를 사용하는 것과 동일하다. 1.application.yml Uri Components Builder를 활용하여 url을 생성할 때 직접 입력하..

기본적인 기능이 갖추어 졌으니, 간단한 프론트를 개발하여 연결해보자. 1. PageController 기존의 ApiController가 아닌 PageController를 만들어 주자. @Controller @RequestMapping("/movie/pages") public class PageController { @GetMapping("/main2") public ModelAndView main(){ return new ModelAndView("main2"); //template 하위경로 } } 이 컨트롤러는 해당 uri로 접속할 경우, tehmplates 하위 경로에 있는 html과 연결시켜 준다. 즉, http://localhost:8080/movie/pages/main2로 접속하면, 작성한 HTM..

그런데 또 다른 문제가 있다. 동일한 영화를 여러 번 저장이 가능하다. [ { "id": 1, "title": "날씨의 아이", "message": null, "stateCode": null, "link": "https://movie.naver.com/movie/bi/mi/basic.nhn?code=181114", "image": "https://ssl.pstatic.net/imgmovie/mdi/mit110/1811/181114_P51_143716.jpg", "subtitle": "Weathering With You", "director": "신카이 마코토|", "actor": "심규혁|김유림|최한|강은애|이장원|손정아|다이고 코타로|모리 나나|오구리 슌|혼다 츠바사|히라이즈미 세이|", "userRa..