티스토리 뷰
별도의 테이블을 통하여 Mapping 정보를 관리한다.
- table: some_mapping_table
column: someMappingId | someEntityId | otherEntityId
@Entity
@Table(schema = "some", name = "some_entity")
public class SomeEntity extends CreatedEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long someEntityId;
private String name;
@OneToMany(fetch = FetchType.EAGER)
@JoinTable(name = "some_mapping_table",
joinColumns = @JoinColumn(name = "someEntityId"),
inverseJoinColumns = @JoinColumn(name = "otherEntityId"))
private List<OtherEntity> otherEntityList;
}
@Entity
@Table(schema = "some", name = "other_entity")
public class OtherEntity extends CreatedEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long otherEntityId;
private String name;
}
'Programming > JPA' 카테고리의 다른 글
복합키 Mapping (0) | 2019.05.30 |
---|---|
Basic Mapping (0) | 2019.05.30 |
Embedded Mapping (0) | 2019.05.29 |
Discriminate Mapping (0) | 2019.05.26 |
Query DSL, Criteria 설정 (0) | 2019.03.01 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Criteria
- scikit-learn
- Join Table
- Discriminate Mapping
- Akka
- 복합키 Mapping
- Spring Registrar
- RetryTemplate
- Mapping
- Embeddable Mapping
- Property
- @Primary
- JPA
- DI
- java Equals
- Sprint RetryTemplate
- Query DSL
- docker
- guava
- Embedded Mapping
- JPA Criteria
- Charles proxy
- Typesafe Config
- java EqualsAndHashCode
- Spring
- Spring JDBC Template
- Registrar
- SmartLifecycle
- java generic
- spring spel
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
글 보관함