fixed some document and id_name

dev-backend
Amagasu 5 months ago
parent e40755598f
commit 85f650812c
  1. 8
      backend/src/main/java/com/example/todoapp/model/RecipeStuffs.java
  2. 10
      backend/src/main/java/com/example/todoapp/model/Recipes.java
  3. 4
      backend/src/main/java/com/example/todoapp/model/Stocks.java
  4. 10
      backend/src/main/java/com/example/todoapp/model/Stuffs.java
  5. 8
      backend/src/main/java/com/example/todoapp/model/ToBuys.java

@ -33,7 +33,7 @@ public class RecipeStuffs {
/** /**
* 料理に必要リストの一意識別子 * 料理種類の一意識別子
*/ */
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@ -49,7 +49,7 @@ public class RecipeStuffs {
referencedColumnName = "recipe_id", referencedColumnName = "recipe_id",
nullable = false nullable = false
) )
private Recipes recipes; private Recipes recipes_id;
/** /**
@ -62,13 +62,13 @@ public class RecipeStuffs {
referencedColumnName = "stuff_id", referencedColumnName = "stuff_id",
nullable = false nullable = false
) )
private Stuffs stuffs; private Stuffs stuffs_id;
/** /**
* 材料の数量 * 材料の数量
*/ */
@NotBlank @NotBlank
@Column(nullable = false) @Column(nullable = false)
private int amount; private int amount = 1;
} }

@ -20,9 +20,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/** /**
* カテゴリエンティティクラス * 料理の種類
* このクラスはタスクのカテゴリ情報を表します
* カテゴリは名前所有ユーザーなどの情報を持ちます
*/ */
@Data @Data
@ -31,21 +29,21 @@ import lombok.NoArgsConstructor;
@Table(name = "recipes") @Table(name = "recipes")
public class Recipes { public class Recipes {
/** /**
* カテゴリID主キー * 料理の一意識別子
*/ */
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private int recipe_id ; private int recipe_id ;
/** /**
* カテゴリ名 * 料理の名前
*/ */
@NotBlank @NotBlank
@Column(unique = true, length = 255, nullable = false) @Column(unique = true, length = 255, nullable = false)
private String recipie_name; private String recipie_name;
/** /**
* カテゴリ * 料理の説明
*/ */
@Column (columnDefinition = "TEXT") @Column (columnDefinition = "TEXT")
private String summary; private String summary;

@ -52,7 +52,7 @@ public class Stocks {
referencedColumnName = "stuff_id", referencedColumnName = "stuff_id",
nullable = false nullable = false
) )
private Stuffs stuffs; private Stuffs stuff_id;
/** /**
@ -62,7 +62,7 @@ public class Stocks {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn( @JoinColumn(
name = "user_id", name = "user_id",
referencedColumnName = "id", referencedColumnName = "user_id",
nullable = false nullable = false
) )
private User user_id; private User user_id;

@ -20,9 +20,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
/** /**
* カテゴリエンティティクラス * 材料の種類
* このクラスはタスクのカテゴリ情報を表します
* カテゴリは名前所有ユーザーなどの情報を持ちます
*/ */
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@ -38,20 +36,20 @@ import lombok.NoArgsConstructor;
private int stuff_id ; private int stuff_id ;
/** /**
* カテゴリ名 * 材料の名前
*/ */
@NotBlank @NotBlank
@Column(unique = true, length = 255, nullable = false) @Column(unique = true, length = 255, nullable = false)
private String stuff_name; private String stuff_name;
/** /**
* カテゴリ * 材料の説明
*/ */
@Column (columnDefinition = "TEXT") @Column (columnDefinition = "TEXT")
private String summary; private String summary;
/** /**
* カテゴリ * 材料の種類
*/ */
@NotBlank @NotBlank
@Column(nullable = false, length = 225) @Column(nullable = false, length = 225)

@ -40,7 +40,7 @@ public class ToBuys {
private int tobuy_id ; private int tobuy_id ;
/** /**
* 材料の一意識別子 FK * 商品テーブル参照用の外部キー
*/ */
@NotBlank @NotBlank
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@ -49,7 +49,7 @@ public class ToBuys {
referencedColumnName = "stuff_id", referencedColumnName = "stuff_id",
nullable = false nullable = false
) )
private Stuffs stuffs; private Stuffs stuffs_id;
/** /**
* ユーザーテーブル参照用の外部キー * ユーザーテーブル参照用の外部キー
@ -58,7 +58,7 @@ public class ToBuys {
@ManyToOne(fetch = FetchType.LAZY) @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn( @JoinColumn(
name = "user_id", name = "user_id",
referencedColumnName = "id", referencedColumnName = "user_id",
nullable = false nullable = false
) )
private User user_id; private User user_id;
@ -74,7 +74,7 @@ public class ToBuys {
* 購入するお店 * 購入するお店
*/ */
@NotBlank @NotBlank
@Column(nullable = false) @Column(nullable = true)
private String store; private String store;
} }

Loading…
Cancel
Save