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
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ -49,7 +49,7 @@ public class RecipeStuffs {
referencedColumnName = "recipe_id",
nullable = false
)
private Recipes recipes;
private Recipes recipes_id;
/**
@ -62,13 +62,13 @@ public class RecipeStuffs {
referencedColumnName = "stuff_id",
nullable = false
)
private Stuffs stuffs;
private Stuffs stuffs_id;
/**
* 材料の数量
*/
@NotBlank
@Column(nullable = false)
private int amount;
private int amount = 1;
}

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

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

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

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

Loading…
Cancel
Save