Hỏi & Đáp
Member 와 Product 객체 사이에 Link 라는 테이블을 만들어서 일대다 + 다대일 방식으로 관계를 맺어주고, 필요할 때에는 JPA 를 통해서 findByMemberAndProduct(Member member, Product product) 이런식으로 Link 테이블을 불러서 Link.product 리스트를 조회할 수 있을겁니다! 이게 바른 방법인지는 저도 정확히는 모르겠어서 조언 얻고 싶습니다^^
2022-06-29T01:46:35.705Z
Lượt thích
0
Số bình luận
2
Lượt xem
409
Hỏi & Đáp
import React , { useEffect , useState } from ' react '; import { FaCode } from " react-icons/fa "; import { API_URL , API_KEY , IMAGE_BASE_URL } from ' ../../Config '; import MainImage from ' ./Sections/MainImage '; // npm run dev function LandingPage () { const [ Movies , setMovies ] = useState ([]) const [ MainMovieImage , setMainMovieImage ] = useState ( null ) useEffect ( () => { const endpoint = ` ${ API_URL } movie/popular?api_key= ${ API_KEY } &language=en-US&page=1 ` ; fetch ( endpoint ) . then ( response => response . json ()) . then ( response => { console . log ( response ) setMovies ([ response . results ]) setMainMovieImage ([ response . results [ 0 ]]) } ) }, []) return ( div style ={{ width : ' 100% ' , margin : ' 0 ' }} > { /* Main Image */ } { MainMovieImage && MainImage image ={ ` ${ IMAGE_BASE_URL } w1280 ${ MainMovieImage . backdrop_path } ` } title ={ MainMovieImage . original_title } text ={ MainMovieImage . overview } /> } div style ={{ width : ' 85% ' , margin : ' 1rem auto ' }} > h2 > Movies by latest h2 > hr /> { /* Movie Grid Cards */ } div > div style ={{ display : ' flex ' , justifyContent : ' center ' }} > button > Load More button > div > div > ) } export default LandingPage 결과 출력이 안 돼요 ㅠㅠ
2021-09-07T11:53:09.317Z
Lượt thích
2
Số bình luận
3
Lượt xem
638