Skip to content

Commit

Permalink
回答コード
Browse files Browse the repository at this point in the history
  • Loading branch information
yukihane committed Jan 28, 2021
1 parent 4dff2fb commit af921fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions jaso73625/src/main/java/com/example/jaso73625/Books.java
@@ -1,9 +1,9 @@
package com.example.jaso73625;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import lombok.Data;

Expand All @@ -15,8 +15,8 @@ public class Books implements Serializable {
@Id
private int id;

@Column(name = "book_category_id")
private int bookCategoryId;
@ManyToOne
private BookCategory bookCategory;

private String name;

Expand Down
2 changes: 1 addition & 1 deletion jaso73625/src/main/resources/templates/books.html
Expand Up @@ -18,7 +18,7 @@
<tr th:each="books : ${booklist}">
<td th:text="${books.id}">a</td>
<td th:text="${books.name}">b</td>
<td th:text="${books.bookCategoryId}">c</td>
<td th:text="${books.bookCategory.category}">c</td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit af921fb

Please sign in to comment.