묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결실전! 스프링 데이터 JPA
GeneratedValue 공유 및 left join 질문
안녕하세요! 유익한 강의 잘 보고 있습니다. Native Query 테스트하는 중에 궁금한 점이 있어서 질문드립니다. @GeneratedValue 는 다른 Entity 끼리 공유하는건가요? Team을 2개 생성하고 Member를 생성하는데 아래 테스트 코드에서 보면 Member의 GeneratedValue 값이 1이 아니라 3부터 시작합니다. NativeQuery에서 left join을 할 때 join 조건을 주고 싶은데 Team entity의 name은 어떻게 접근해야 할까요? @Query(value = "select m.member_id as id, m.name as name, t.name as teamName from member m left join team t ", nativeQuery = true, countQuery = "select count(*) from member") 이 쿼리를 쓰면 full join이 되서 12개의 row가 검색됩니다. on 조건이나 where 절에서 m.teamName = t.name 의 조건을 주고 싶으면 m.teamName 이라는 값을 어떻게 가져와야 하나요 ? createdDate, updatedDate를 BaseEntity로 분리하면 @ToString(of = "createdDate, updatedDate") 에서 사용할 수 없는건가요 ? public class Member extends BaseEntity { @Id@GeneratedValue @Column(name = "member_id") private Long id; private String name; private String sex; private Integer age; private String city; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "team_id") private Team team; public Member(String name, String sex, Integer age, String city, Team team) { this.name = name; this.sex = sex; this.age = age; this.city = city; if(team != null) changeTeam(team); } // 양방향 연관관계 한번에 처리(연관관계 편의 메소드) public void changeTeam(Team team) { this.team = team; team.getMembers().add(this); } } public class Team { @Id @GeneratedValue @Column(name = "team_id") private Long id; @NonNull private String name; @OneToMany(mappedBy = "team") List<Member> members = new ArrayList<>(); } @Test public void nativeQuery() { Team teamA = new Team("teamA"); Team teamB = new Team("teamB"); teamRepository.save(teamA); teamRepository.save(teamB); memberRepository.save(new Member("1", "남자", 18, "서울", teamA)); memberRepository.save(new Member("2", "남자", 19, "경기", teamA)); memberRepository.save(new Member("3", "여자", 20, "부산", teamB)); memberRepository.save(new Member("4", "여자", 21, "울산", teamB)); memberRepository.save(new Member("5", "남자", 22, "포항", teamA)); memberRepository.save(new Member("6", "여자", 23, "전주", teamA)); Member selectedMember = memberRepository.findNativeQueryByName("2"); assertThat(selectedMember.getName()).isEqualTo("2"); Page<MemberProjection> page = memberRepository.findByProjection(PageRequest.of(0, 20)); List<MemberProjection> content = page.getContent(); System.out.println("==============================="); teamRepository.findAll().forEach(System.out::println); System.out.println("==============================="); memberRepository.findAll().forEach(System.out::println); System.out.println("==============================="); for(MemberProjection mp : content){ System.out.println("[ id = " + mp.getId() + ", name = " + mp.getName() + ", teamName = " + mp.getTeamName() + "]"); } }
-
미해결[리뉴얼] 코딩자율학습 제로초의 자바스크립트 입문
let으로 구조분해할당을 했을 때 궁금한 점이 생겼습니다!
else if (input === '3') { // 도망 let { monster } = this; monster = null; this.updateMonsterStat(); this.changeScreen('game'); this.showMessage(`무사히 ${this.monster.name}에게서 도망쳤습니다!`); } 위와 같은 코드에서 this.updateMonsterStat()을 하면 텍스트를 지워주지 않는 것인지 궁금합니다! 배틀 부분에서 도망을 구현하고 있었습니다. 근데 습관적으로 구조분해할당을 const로 하고 monster를 null로 바꾸려고 하니 오류가 발생했습니다. 그래서 아무 생각 없이 let으로 구조분해할당을 했습니다. 그런데 여기서 monster = null을 한뒤 this.updateMonsterStat()을 했을 때 당연히 맨 아래 몬스터에 관련된 텍스트가 지워질 줄 알았는데, 지워지지 않았습니다. 그래서 monster.hp -= 10을 해봤더니 이거는 또 동작을 해서 혼란스럽습니다... 이 부분은 어떠한 문제가 있는 건가요??
-
미해결배달앱 클론코딩 [with React Native]
React Native iOS SSL 통신 오류 문의 드립니다.
sslTest() { var url = 'https://test.com/mainlist' return new Promise((resolve, reject) => fetchSSL(url, { method: "GET" , timeoutInterval: 3000, // milliseconds headers: { 'Accept': "application/json; charset=utf-8", "Access-Control-Allow-Origin": "*", "e_platform": "mobile", 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-store', 'Expires': '0' }, sslPinning: { certs: ['cert', 'cert2'] // your certificates name (without extension), for example cert1.cer, cert2.cer } }).then((response) => { response.json().then((data) => { if (response.status == 200){ resolve(data) console.log(data) } else { resolve(null) } }); }).catch((error) => { resolve(null) console.log(error) }) ); } React Native https 통신할 때 'react-native-ssl-pinning' 라이브러리를 활용합니다. 여기서 문제점은 안드로이드 환경에서는 https 통신이 정상적으로 이루어집니다. 다만, iOS에서는 인증서 위치가 올바르지 않아서인지, https 통신이 이루어지지 않습니다. iOS 환경에서는 https 인증서 파일 위치를 어디에 업로드해야 하는지 문의 드립니다. 부가적으로 자주 사용되는 iOS https 네트워크 라이브러리가 있으면 공유 부탁드립니다. - 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.
-
해결됨[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part2: 자료구조와 알고리즘
enum Dir 질문입니다.
혹시 방향 순서 같은 건 일반적인 경우에 '위-왼-아래-오'를 사용하나요? 오른손 법칙이고 로직 내에도 오른쪽으로 도는 걸 먼저 하는 방식인데 enum의 순서은 왼쪽으로 도는 것 처럼 되어 있어서요
-
미해결그림으로 배우는 자바, 파트2: 객체지향!
안녕하세요. 생성자관련?하여 질문드립니다.
자식클래스가 부모클래스를 상속하는 경우에 부모클래스의 필드값을 쓰고싶으면 생성자를 통해 초기화를 보통 했었는데요. 갑자기 든 생각인데 자식클래스에서 부모클래스의 값을 바로 초기화 할 수 있는 방법은 없는걸까요? 부모클래스(동물), 자식클래스(조류)인 경우에 public class 동물{ String value; } 일때 자식클래스에서 동물의 참조변수를 만들어서 동물 클래스의 value에 접근하려해도 안되고, 당연하지만 '.'으로 접근도 불가능해서 public class 조류{ public 조류(){ value = "새"; } } 이런식으로 꼭 생성자를 통해서만 초기화가 가능한걸까요?
-
미해결[C#과 유니티로 만드는 MMORPG 게임 개발 시리즈] Part4: 게임 서버
OnAcceptCompeted 함수 질문드립니다..
_onAcceptHandler.Invoke(args.AcceptSocket); 부분에서 _onAcceptHandler에서 object가 null 값이 되면서 오류가 발생합니다. 이 오류가 왜 발생하는지 잘 모르겠습니다.
-
해결됨Vue.js 끝장내기 - 실무에 필요한 모든 것
질문있습니다!
클론을받고서 npm i 를했는데 이렇게뜨네요..npm audit fix 를하면 found숫자가 줄기는합니다 근데 다줄지는않아요
-
해결됨13가지 예제로 배우는 CSS Flex & Grid 핵심 기능
한꺼번에 잡는 단축키
1:20 에 나오는 한꺼번에 잡는 단축키가 무엇일까요..?
-
미해결Three.js로 시작하는 3D 인터랙티브 웹
혹시 gltfloader
수업 들은 예제들을 리액트 프로젝트에서 열어보려고 react-create-app 으로 프로젝트 생성한 다음 컴포넌트 만들고 canvas 태그 만든후 useRef로 접근하여 렌더러 생성해주었습니다. 그리고 gltfLoader 사용해서 만든 glb 파일 불러오려는데 GLTFLoader.js:185 SyntaxError: Unexpected token < in JSON at position 0 자꾸 이렇게 에러가 뜹니다 ㅠㅠ 어떤게 문제인가요..?
-
해결됨실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
일대 다 & 다대일 관계 삭제 시
안녕하세요! 더운 여름인데 건강은 잘 챙기고 계신지요? 항상 고생 많으십니다! 예제의 Order - OrderItem - Item 관계에서 삭제 시에 궁금한 점이 있어서 고민하다가 남겨봅니다..! 현재 Order에서 OrderItem을 @OneToMany(cascadeType.ALL)로 가지고 있어, Order save & 삭제시에는 OrderItem이 cascade 되어 저장, 삭제가 되고 있습니다. 하지만 Item에는 OrderItem -> Item간 단방향 mapping만 걸려있습니다. 만약 Item이 삭제될 경우에는 FK 제약조건으로 예외가 발생하게 됩니다. 이를 위한 해결방안으로 아래 3가지를 고려해보았습니다. Item에도 OrderItem Collection을 두고, Cascade 또는 Orphanremoval을 통해 연관된 OrderItem을 삭제한다.-> 삭제 시에만 사용되므로 비효율적으로 생각됨. Item을 soft delete로 관리한다. OrderItem(repository)을 대상으로 삭제하려는 Item을 FK로 가진 내용을 모두 삭제한 후 마지막으로 Item을 제거한다. 여러 질문에서 남겨주신 Cascade 관련 답변을 읽어보았고, 해당 엔티티를 한쪽에서 life cycle을 확실히 관리할 경우에만 사용하라고 이해를 했습니다. 하지만 위의 1처럼 양쪽에서 관리를 할 경우에도 개발자가 확실하게 life cycle을 이해한다면 문제가 없을 것으로 보이는데, 잘못 생각하고 있는걸까요? 중간 테이블에 대한 추가 / 제거를 고려하기가 쉽지 않네요..! 고려한 방법에서 발생할 수 있는 문제가 어떤건지, 더 좋은 방법이 있는지 질문드립니다!
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
mmdetection mask-rcnn 추론결과 title 이름 변경 관련
안녕하세요 강사님 mmdetection 관련해서 이론적으로나 실무적으로나 항상 많은 도움 받고있습니다. 강의 내용을 바탕으로 mmdetection code를 작성하던 도중 질문사항이 생겨서요 ㅎㅎ mmdetection Mask R-CNN 모델을 이용하여 추론결과 아래 사진과 같이 mask, bbox 두가지가 나타나는데 bbox위에 나타나는 title(coin) 대신 변수를 표시하고 싶습니다. class name, confidence score 가 아닌 ID, pixel number를 표시하고 싶습니다. 제 코드는 다음과 같습니다. img_name = path_dir + '/' + file_list[i] img_arr= cv2.imread(img_name, cv2.IMREAD_COLOR) img_arr_rgb = cv2.cvtColor(img_arr, cv2.COLOR_BGR2RGB) # cv2.imshow('img',img) fig= plt.figure(figsize=(12, 12)) plt.imshow(img_arr_rgb) # inference_detector의 인자로 string(file경로), ndarray가 단일 또는 list형태로 입력 될 수 있음. results = inference_detector(model, img_arr) #추론결과 디렉토리에 저장 model.show_result(img_arr, results, score_thr=0.8, title= bbox_color=(0,0,255),thickness=0.5,font_size=7, out_file= f'{save_dir1}{file_list[i]}') 이 결과 추론되는 사진은 다음과 같습니다 아래는 mmdetection/mmdet/core/visualization/image.py에 있는 imshow_det_bboxes 함수입니다. 아래 함수가 시각화 해주는 함수여서 해당 함수를 수정하면 될 것 같은데 아무리 뜯어봐도 어디를 고쳐야할 지 도저히 감이 오질 않습니다 ...ㅠㅠ def imshow_det_bboxes(img, bboxes, labels, segms=None, class_names=None, score_thr=0, bbox_color='green', text_color='green', mask_color=None, thickness=2, font_size=13, win_name='', show=True, wait_time=0, out_file=None): """Draw bboxes and class labels (with scores) on an image. Args: img (str or ndarray): The image to be displayed. bboxes (ndarray): Bounding boxes (with scores), shaped (n, 4) or (n, 5). labels (ndarray): Labels of bboxes. segms (ndarray or None): Masks, shaped (n,h,w) or None class_names (list[str]): Names of each classes. score_thr (float): Minimum score of bboxes to be shown. Default: 0 bbox_color (str or tuple(int) or :obj:`Color`):Color of bbox lines. The tuple of color should be in BGR order. Default: 'green' text_color (str or tuple(int) or :obj:`Color`):Color of texts. The tuple of color should be in BGR order. Default: 'green' mask_color (str or tuple(int) or :obj:`Color`, optional): Color of masks. The tuple of color should be in BGR order. Default: None thickness (int): Thickness of lines. Default: 2 font_size (int): Font size of texts. Default: 13 show (bool): Whether to show the image. Default: True win_name (str): The window name. Default: '' wait_time (float): Value of waitKey param. Default: 0. out_file (str, optional): The filename to write the image. Default: None Returns: ndarray: The image with bboxes drawn on it. """ assert bboxes.ndim == 2, \ f' bboxes ndim should be 2, but its ndim is {bboxes.ndim}.' assert labels.ndim == 1, \ f' labels ndim should be 1, but its ndim is {labels.ndim}.' assert bboxes.shape[0] == labels.shape[0], \ 'bboxes.shape[0] and labels.shape[0] should have the same length.' assert bboxes.shape[1] == 4 or bboxes.shape[1] == 5, \ f' bboxes.shape[1] should be 4 or 5, but its {bboxes.shape[1]}.' img = mmcv.imread(img).astype(np.uint8) if score_thr > 0: assert bboxes.shape[1] == 5 scores = bboxes[:, -1] inds = scores > score_thr bboxes = bboxes[inds, :] labels = labels[inds] if segms is not None: segms = segms[inds, ...] mask_colors = [] if labels.shape[0] > 0: if mask_color is None: # Get random state before set seed, and restore random state later. # Prevent loss of randomness. # See: https://github.com/open-mmlab/mmdetection/issues/5844 state = np.random.get_state() # random color np.random.seed(42) mask_colors = [ np.random.randint(0, 256, (1, 3), dtype=np.uint8) for _ in range(max(labels) + 1) ] np.random.set_state(state) else: # specify color mask_colors = [ np.array(mmcv.color_val(mask_color)[::-1], dtype=np.uint8) ] * ( max(labels) + 1) bbox_color = color_val_matplotlib(bbox_color) text_color = color_val_matplotlib(text_color) img = mmcv.bgr2rgb(img) width, height = img.shape[1], img.shape[0] img = np.ascontiguousarray(img) fig = plt.figure(win_name, frameon=False) plt.title(win_name) canvas = fig.canvas dpi = fig.get_dpi() # add a small EPS to avoid precision lost due to matplotlib's truncation # (https://github.com/matplotlib/matplotlib/issues/15363) fig.set_size_inches((width + EPS) / dpi, (height + EPS) / dpi) # remove white edges by set subplot margin plt.subplots_adjust(left=0, right=1, bottom=0, top=1) ax = plt.gca() ax.axis('off') polygons = [] color = [] for i, (bbox, label) in enumerate(zip(bboxes, labels)): bbox_int = bbox.astype(np.int32) poly = [[bbox_int[0], bbox_int[1]], [bbox_int[0], bbox_int[3]], [bbox_int[2], bbox_int[3]], [bbox_int[2], bbox_int[1]]] np_poly = np.array(poly).reshape((4, 2)) polygons.append(Polygon(np_poly)) color.append(bbox_color) label_text = class_names[ label] if class_names is not None else f'class {label}' if len(bbox) > 4: label_text += f'|{bbox[-1]:.02f}' ax.text( bbox_int[0], bbox_int[1], f'{label_text}', bbox={ 'facecolor': 'black', 'alpha': 0.8, 'pad': 0.7, 'edgecolor': 'none' }, color=text_color, fontsize=font_size, verticalalignment='top', horizontalalignment='left') if segms is not None: color_mask = mask_colors[labels[i]] mask = segms[i].astype(bool) img[mask] = img[mask] * 0.5 + color_mask * 0.5 plt.imshow(img) p = PatchCollection( polygons, facecolor='none', edgecolors=color, linewidths=thickness) ax.add_collection(p) stream, _ = canvas.print_to_buffer() buffer = np.frombuffer(stream, dtype='uint8') img_rgba = buffer.reshape(height, width, 4) rgb, alpha = np.split(img_rgba, [3], axis=2) img = rgb.astype('uint8') img = mmcv.rgb2bgr(img) if show: # We do not use cv2 for display because in some cases, opencv will # conflict with Qt, it will output a warning: Current thread # is not the object's thread. You can refer to # https://github.com/opencv/opencv-python/issues/46 for details if wait_time == 0: plt.show() else: plt.show(block=False) plt.pause(wait_time) if out_file is not None: mmcv.imwrite(img, out_file) plt.close() return img 감사합니다
-
미해결파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트
uuid 에러 관련입니다!
어디서 에러가 발생한 것인지는 알겠으나 왜 에러가 발생한건지, 또 해결 방법은 무엇인지가 너무 궁금합니다!
-
미해결모든 개발자를 위한 HTTP 웹 기본 지식
돌아왔습니다..
개발에 대하여 더 깊이 학습하고자 김영한님 스프링MVC강의를 듣는 도중에 HTTP에 대한 지식이 너무 부족하다 느껴서 듣던 스프링mvc 강의를 멈추고 이번 강의부터 시작하여 HTTP에 대한 이해를 더 높이고 스프링MVC강의를 다시 들으려 합니다 ! 화이팅
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
test 오류 질문
test 부분 실습하면서 코드를 그대로 작성했는데 계속 같은 오류가 뜹니다...! 코드는 똑같이 적어서도 했고 복사 후 붙여넣기도 해 봤는데 안 돼서 문의 드립니다!! 아마 get 부분에서 계속 오류가 나는 것 같습니다
-
미해결비전공 기획자 및 관리자를 위한 IT 필수 지식
강의 자료 요청
강사님, 안녕하세요. 강의자료 요청 드립니다. 아래 메일로 공유 부탁드립니다! goonee265@naver.com
-
해결됨Slack 클론 코딩[백엔드 with NestJS + TypeORM]
쿼리빌더 사용과 조인과 셀렉트에 관련된 질문입니다.
안녕하세요 조현영님. 이번에는 쿼리빌더로 원하는 데이터를 얻기 위해 조인과 셀렉트 과정에서 오류가 발생하여 질문드립니다. 일단 질문을 드리기 전에 제 상황에 대한 사전지식이 필요하기 때문에 코드를 같이 보여드리겠습니다. @Entity("users") export class UserEntity extends CommonEntity { @OneToOne(() => UserProfileEntity, (common) => common.id) @JoinColumn({ name: "commonId", referencedColumnName: "id" }) profile: UserProfileEntity; @OneToOne(() => UserAuthEntity, (auth) => auth.id) @JoinColumn({ name: "authId", referencedColumnName: "id" }) auth: UserAuthEntity; @OneToOne(() => UserActivityEntity, (activity) => activity.id) @JoinColumn({ name: "activityId", referencedColumnName: "id" }) activity: UserActivityEntity; } 사용자에 관련된 엔티티입니다. 사용자와 관련된 컬럼들은 세부적으로 엔티티를 나눈 다음 그 엔티티안에 정의 해두었습니다. 사용자 엔티티에는 프로필, 인증, 활동 엔티티의 아이디만 존재합니다. 아래에는 사용자 엔티티에게 상속을 해주는 CommonEntity입니다. export abstract class CommonEntity { @IsUUID() @PrimaryGeneratedColumn("uuid") id: string; @CreateDateColumn({ type: "timestamp" }) createdAt: Date; @UpdateDateColumn({ type: "timestamp" }) updatedAt: Date; @DeleteDateColumn({ type: "timestamp" }) deletedAt: Date | null; } 아래에는 각각 프로필, 인증, 활동 엔티티의 대한 코드입니다. @Entity("users profile") export class UserProfileEntity { @PrimaryGeneratedColumn("uuid") id: string; @IsString() @IsNotEmpty() @Column({ type: "varchar", length: 20, nullable: false }) realname: string; @IsDateString() @IsNotEmpty() @Column({ type: "date", nullable: false }) birth: Date; @IsEnum(["male", "female"]) @IsNotEmpty() @Column({ type: "enum", enum: ["male", "female"] }) gender: "male" | "female"; @IsMobilePhone() @IsNotEmpty() @Column({ type: "varchar", length: 15, unique: true, nullable: false }) phonenumber: string; @OneToOne(() => UserEntity) user: UserEntity; } @Entity("users auth") export class UserAuthEntity { @PrimaryGeneratedColumn("uuid") id: string; @IsString() @IsNotEmpty() @Column({ type: "varchar", length: 20, unique: true, nullable: false }) nickname: string; @IsEmail() @IsNotEmpty() @Column({ type: "varchar", length: 60, unique: true, nullable: false }) email: string; @IsString() @IsNotEmpty() @Matches(/^[A-Za-z\d!@#$%^&*()]{8,30}$/) @Column({ type: "varchar", nullable: false }) password: string; @Column({ type: "enum", enum: ["general", "special", "admin"], default: "general", }) userType: "general" | "special" | "admin"; @OneToOne(() => UserEntity) user: UserEntity; @OneToMany(() => ImagesEntity, (join) => join.uploader) image: ImagesEntity[]; } @Entity("users activity") export class UserActivityEntity { @PrimaryGeneratedColumn("uuid") id: string; @Column({ type: "smallint", default: 0 }) bonusPoint: number; @Column({ type: "smallint", default: 0 }) purchaseCount: number; @Column({ type: "smallint", default: 0 }) productInquiryCount: number; @Column({ type: "smallint", default: 0 }) productReviewCount: number; @OneToOne(() => UserEntity) user: UserEntity; @OneToMany(() => ReviewEntity, (review) => review.reviewer) review: ReviewEntity; } 이런식으로 한 사용자 엔티티에는 프로필, 인증, 활등 에 대한 엔티티와 1:1 관계를 설정 해 두었습니다. 그리고 이제 특정 사용자에 대한 정보를 가져올 때 사용되는 메서드입니다. async findUserWithId(userId: string): Promise<UserEntity> { try { return await this.userRepository .createQueryBuilder("user") .innerJoinAndSelect("user.profile", "profile") .innerJoinAndSelect("user.auth", "auth") .innerJoinAndSelect("user.activity", "activity") .where("user.id = :id", { id: userId }) .getOneOrFail(); } catch (err) { throw new UnauthorizedException("해당 사용자아이디는 존재하지 않습니다."); } } userId 매개변수는 CommenEntity에서 상속된 id컬럼을 사용합니다. 즉 사용자 엔티티 id라고 보시면 됩니다. userRepository또한 아래처럼 사용자 엔티티의 리파지토리입니다. @InjectRepository(UserEntity) private readonly userRepository: Repository<UserEntity> 이제 본격적으로 문제에 관련된 질문을 드리자면 innerJoinAndSelect를 사용할 시 관계가 맺어진 엔티티들의 정보들을 모두 가져오게 되어서 노출이 되어서는 안될 비밀번호등 까지 보여지게 됩니다. 그래서 저는 innerJoinAndSelect대신 innerJoin으로 관계가 맺어진 엔티티들을 조인하고 select메서드로 원하는 컬럼만 선택하려했습니다. async findUserWithId(userId: string): Promise<UserEntity> { try { return await this.userRepository .createQueryBuilder("user") .select(this.select.UserInformationReturnProperty) .innerJoin("user.profile", "profile") .inneroin("user.auth", "auth") .innerJoin("user.activity", "activity") .where("user.id = :id", { id: userId }) .getOneOrFail(); } catch (err) { throw new UnauthorizedException("해당 사용자아이디는 존재하지 않습니다."); } } select안에 인수는 아래와 같습니다. UserInformationReturnProperty: [ "profile.realname", "auth.nickname", "profile.birth", "profile.gender", "auth.email", "profile.phonenumber", "auth.userType", "activity.purchaseCount", "activity.bonusPoint", "activity.productInquiryCount", "activity.productReviewCount", ] 이렇게 보여줘도 상관없을 만한 정보들로 구성하였습니다. 문제는 이렇게 하고 쿼리를 돌렸을 때 'EntityNotFoundError: Could not find any entity of type "UserEntity" matching: [object Object]'이런 오류가 납니다. 해석해보면 '일치하는 "UserEntity" 유형의 엔터티를 찾을 수 없음' 이런 뜻인거 같은데 분명히 리파지토리도 UserEntity이고 select 대신 innerJoinAndSelect를 하면 정상적으로 불러와 지는데 어떤 부분이 잘못된건지 모르겠어서 질문드립니다.
-
미해결파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트
col-sm-12 태그에서 post_card 와 timeline_sidebar 가 가로로 정렬이 되지 않습니다
안녕하십니까 :) 유익한 수업 잘 듣고 있습니다! django templates 관련해서 index.html 태그와 timeline_sidebar.html 에서 코드가 동일한데 좌 우가 아닌 위 아래로 배치가 되고 있어요. (하단의 그림 1) 1. 검사와 html 태그와의 차이점(이상하다고 느낀 점) index.html 에서는 row 태그 안에 col-sm-8 과 col-sm-4 태그를 넣어서 배치했는데, 실제 웹에서 보면 col-sm-4 코드가 바깥으로 나온 것으로 보여집니다. include 를 해서 그런것인지, 그리드를 잘못 활용한 것인지 이유와 해결책이 궁금합니다! (그림 1)
-
미해결스프링 핵심 원리 - 고급편
추상클래스의 메서드를 포인트컷으로 잡을 수 없나요?
안녕하세요. AOP 포인트컷 관련 테스트를하다가 제가 잘 모르는 부분이 있어서 질문을 드립니다. 인터페이스에서 구체클래스의 내부메서드를 포인트컷으로 잡지 못하는것은 이해가 잘되는데요. 구체클래스(자식클래스)에서 부모클래스를 잡을 수 있을것이라고 생각했는데테스트해보니, 제 의도와 다른결과가 나오더라고요. 프록시는 프록시 클래스의 메서드(직접 정의했거나 Override)만 대상이 되나요? 어떤부분,키워드로 이해를 위한, 부족한 지식을 보완할 수 수 있을까요..?강의에 언급되었는데 제가 놓쳤다면, 그 부분을 알려주시면 다시 보도록 하겠습니다. 감사합니다. --- 샘플코드: https://github.com/seolys/spring-aop-pointcut-oop- 테스트코드로 작성하였습니다: 테스트코드 경로
-
미해결파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)
이렇게 풀어도 될까요??
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 import sys sys.stdin=open("pythonalgorithm/섹션 2/9. 주사위 게임/in1.txt", "rt") n=int(input()) tot=[] for _ in range(n): tmp=list(map(int,input().split())) tmp.sort() a, b, c = tmp if a==b==c: tot.append(10000+a*1000) elif a==b or a==c: tot.append(1000+a*100) elif b==c: tot.append(1000+b*100) else: tot.append(c*100) print(max(tot)) 운영 관련 문의는 1:1 문의하기를 이용해주세요.
-
미해결[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
노드 버전에 따른 패키지 버전 관련하여 궁금합니다.
선생님 안녕하세요, 좋은 강의 잘 듣고있습니다. 다름이 아니라 노드 버전에 따른 패키지 버전 관련하여 궁금합니다. 예를 들어 예전 노드 버전에서 최신 express 패키지를 사용하면 문제가 있을 수 있는 것처럼 해당 노드 버전에 맞는 패키지 버전을 알 수 있는 npm 명령어 또는 사이트가 있는지 궁금합니다. 구글링을 해봤는데, 잘 안나오네요... ㅠㅠ 혹시 알고 계시다면 답변 부탁드리겠습니다. 강의랑 책 모두 잘 보고있습니다. 감사합니다 :)