소개
게시글
스터디
모집중
2024.11.14 19:17
백엔드 모각코 모집해요!
- 0
- 0
- 99
질문&답변
2022.12.11
memberUpdateDto가 필요한 이유
답변 감사합니다.저장과 수정에 사용되는 필드가 몇개정도 다를때 분리하는게 좋을까요..?한두개만 달라도 분리해야하는건가요..?
- 0
- 2
- 399
질문&답변
2022.11.04
merge
헉 이 블로그글 엄청 유익하군요 감사합니다
- 1
- 2
- 306
질문&답변
2022.11.04
값 타입 컬렉션의 제약사항
package jpaStudy.ex.entity; import lombok.*; import javax.persistence.*; import java.util.List; @Entity @Getter @Setter @Builder @NoArgsConstructor @AllArgsConstructor @NamedQuery( name = "Member.findByUsername", query = "select m from Member m where m.name = :name" ) public class Member { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "MEMBER_ID") private Long id; @Column private String name; private Integer age; @ElementCollection @CollectionTable(name = "Address", joinColumns = @JoinColumn(name = "MEMBER_ID")) private List addressList; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "team_id") private Team team; @ManyToOne @JoinColumn(name = "group1_id") private Group1 group1; @Embedded private Address myAddress; } package jpaStudy.ex.entity; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import javax.persistence.Embeddable; @Embeddable @AllArgsConstructor @NoArgsConstructor @Getter public class Address { private String zipCode; private String code; }
- 0
- 3
- 334
질문&답변
2022.11.04
임베디드 컬렉션 값 조회 jpql시 오류
package jpaStudy.ex.entity; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import javax.persistence.Embeddable; @Embeddable @AllArgsConstructor @NoArgsConstructor @Getter public class Address { private String zipCode; private String code; }package jpaStudy.ex.entity; import lombok.*; import javax.persistence.*; import java.util.List; @Entity @Getter @Setter @Builder @NoArgsConstructor @AllArgsConstructor @NamedQuery( name = "Member.findByUsername", query = "select m from Member m where m.name = :name" ) public class Member { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "MEMBER_ID") private Long id; @Column private String name; private Integer age; @ElementCollection @CollectionTable(name = "Address", joinColumns = @JoinColumn(name = "MEMBER_ID")) private List addressList; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "team_id") private Team team; @ManyToOne @JoinColumn(name = "group1_id") private Group1 group1; @Embedded private Address myAddress; }
- 0
- 3
- 261