<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h3>주소목록(address1)</h3>
<a th:href="@{/member1/selectlist.do}"><button>회원목록</button></a>
<hr />
회원아이디:<label th:text="${obj.id}"></label><br />
회원이름:<label th:text="${obj.name}"></label><br />
<hr />
<h3>주소목록</h3>
<table border="1">
<thead>
<tr>
<th>주소번호</th>
<th>주소번호</th>
<th>주소</th>
<th>날짜</th>
<th>버튼</th>
</tr>
</thead>
<tbody>
<tr th:each="tmp : ${address}">
<td th:text="${tmp.no}"></td>
<td th:text="${tmp.postcode}"></td>
<td th:text="${tmp.address}"></td>
<td th:text="${tmp.regdate}"></td>
<td>
<form th:action="@{/address1/delete.do}" method="post">
<input type="text" name="no1" th:value="${tmp.no}" />
<input type="text" name="id1" th:value="${obj.id}" />
<input type="submit" value="삭제" />
</form>
</td>
</tr>
</tbody>
</table>
<th:block th:each="num : ${#numbers.sequence(1, pages)}">
<a th:href="@{/address1/selectlist.do(id=${param.id}, page=${num})}" th:text="${num}"></a>
</th:block>
<hr />
<h3>주소등록</h3>
<form th:action="@{/address1/insert.do}" method="post">
<input type="text" name="member1.id" th:value="${obj.id}" readonly />
<input type="text" name="postcode" placeholder="우편번호" />
<input type="text" name="address" placeholder="주소" />
<input type="submit" value="주소등록" />
</form>
</body>
</html>
@Data
@Entity
@Table(name = "BOARDIMAGE1")
@SequenceGenerator(name = "SEQ_BOARDIMAGE1_NO", sequenceName = "SEQ_BOARDIMAGE1_NO", initialValue = 1, allocationSize = 1)
public class BoardImage1 {
// 이미지번호
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_BOARDIMAGE1_NO")
private long no;
// 이미지명
private String imageName;
// 이미지타입(IMAGE_TYPE)
private String imageType;
// 이미지사이즈 (IMAGE_SIZE)
private long imageSize;
// 이미지데이터
@Lob
@ToString.Exclude
private byte[] imageData;
// 등록일
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
@CreationTimestamp
@Column(name = "REGDATE", insertable = true, updatable = false)
private Date regdate;
// 외래키 (게시글번호)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "BRDNO", referencedColumnName = "NO")
private Board1 board1;
}