티스토리 뷰
User.java
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
package com.woon.web.entities;
import java.sql.Timestamp;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.CreationTimestamp;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* WoonUser
*/
@NoArgsConstructor(access = AccessLevel.PUBLIC)
@Entity
@Getter
@Setter
@ToString
@Table(name = "woon_users")
public class WoonUser {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long uno;
@Column(name = "user_email", nullable = false, unique = true)
private String userEmail;
@Column(name = "user_name", nullable = false)
private String userName;
@Column(name = "password", nullable = false)
private String password;
@Column(name = "profile", nullable = true)
private String profile;
@Column(name = "profile_path", nullable = true)
private String profilePath;
@CreationTimestamp
@Column(name = "signup_date", nullable = false)
private Timestamp signupDate;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "woonUsers")
private List<WoonJoinGroup> woonJoingroups;
}
|
cs |
Group.java
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
package com.woon.web.entities;
import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* WoonGroup
*/
@NoArgsConstructor(access = AccessLevel.PUBLIC)
@Entity
@Getter
@Setter
@ToString
@Table(name = "tbl_groups")
public class WoonGroup implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long groupno;
@Column(name = "group_name", unique = true, nullable = false)
private String groupName;
@Column(name = "group_info", nullable = false)
private String groupInfo;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "WoonGroups")
private List<WoonJoinGroup> woonJoingroups;
@Override
public String toString(){
return String.format("GROUP NO: %d\n"
+"GROUP NAME: %s\n"
+"GROUP INFO: %s\n"
, groupno, groupName, groupInfo);
}
@Builder
private WoonGroup(String groupName, String groupInfo){
this.groupName = groupName;
this.groupInfo = groupInfo;
}
}
|
cs |
JoinGroup.java
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
package com.woon.web.entities;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.ColumnDefault;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* WoonJoinGroup
*/
@NoArgsConstructor(access = AccessLevel.PUBLIC)
@Entity
@Getter
@Setter
@ToString
@Table(name = "tbl_joingroups")
public class WoonJoinGroup implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long jgrno;
@Column(name = "group_leader")
private String groupLeader;
@ManyToOne
@JoinColumn(name="groupno")
private WoonGroup WoonGroups;
@ManyToOne
@JoinColumn(name="uno")
private WoonUser woonUsers;
}
|
cs |
'9. 프로그램' 카테고리의 다른 글
JPA OneToMany WoonUser.java (0) | 2020.08.02 |
---|---|
Intellij에서 JPA 사용시 Querydsl 에러 해결 (0) | 2020.07.16 |
프로그램/VS코드/2020-06-20/ 오픈소스 프로젝트 인기 1위는 'VScode' (0) | 2020.06.20 |
JPA import com.sun.istack.NotNull 로 인한 에러 발생 (0) | 2020.05.27 |
(타슈켄트) JPA> 쇼핑몰플젝 Customer.java, CustomerDTO.java, CustomerController.java, CustomerRepository.java (0) | 2020.05.10 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Django
- AWS
- terms
- Mongo
- ERD
- Algorithm
- SQLAlchemy
- Git
- COLAB
- tensorflow
- Mlearn
- vscode
- jQuery
- intellij
- Oracle
- JPA
- Java
- docker
- JUnit
- KAFKA
- React
- database
- Eclipse
- Python
- mariadb
- nodejs
- SpringBoot
- maven
- FLASK
- springMVC
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함