[EDIT] 改行・コード位置を調整しました。
This commit is contained in:
@@ -27,6 +27,14 @@ public class TransactionEntity {
|
|||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
@Column(name = "transaction_id")
|
@Column(name = "transaction_id")
|
||||||
private Long transactionId;
|
private Long transactionId;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "user_id")
|
||||||
|
private UserEntity userEntity;
|
||||||
|
|
||||||
|
@ManyToOne(fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "category_id")
|
||||||
|
private CategoryEntity categoryEntity;
|
||||||
|
|
||||||
@Column(name = "amount", nullable = false)
|
@Column(name = "amount", nullable = false)
|
||||||
private Integer amount;
|
private Integer amount;
|
||||||
@@ -34,12 +42,4 @@ public class TransactionEntity {
|
|||||||
@Column(name = "transaction_date", nullable = false)
|
@Column(name = "transaction_date", nullable = false)
|
||||||
private LocalDate transactionDate;
|
private LocalDate transactionDate;
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
|
||||||
@JoinColumn(name = "user_id")
|
|
||||||
private UserEntity userEntity;
|
|
||||||
|
|
||||||
@ManyToOne(fetch = FetchType.LAZY)
|
|
||||||
@JoinColumn(name = "category_id")
|
|
||||||
private CategoryEntity categoryEntity;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class TransactionForm {
|
|||||||
|
|
||||||
private Integer transactionType;
|
private Integer transactionType;
|
||||||
|
|
||||||
|
|
||||||
public static TransactionForm convertFrom(TransactionModel transactionModel, String categoryName, int income, int expense, int transactionType) {
|
public static TransactionForm convertFrom(TransactionModel transactionModel, String categoryName, int income, int expense, int transactionType) {
|
||||||
return new TransactionForm(
|
return new TransactionForm(
|
||||||
transactionModel.getTransactionId(),
|
transactionModel.getTransactionId(),
|
||||||
@@ -45,6 +46,7 @@ public class TransactionForm {
|
|||||||
transactionType);
|
transactionType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static List<TransactionForm> convertFrom(List<TransactionModel> transactionModelList, String categoryName, int income, int expense, int transactionType ) {
|
public static List<TransactionForm> convertFrom(List<TransactionModel> transactionModelList, String categoryName, int income, int expense, int transactionType ) {
|
||||||
return transactionModelList.stream().map(transactionModel -> TransactionForm.convertFrom(transactionModel, categoryName, income, expense, transactionType)).toList();
|
return transactionModelList.stream().map(transactionModel -> TransactionForm.convertFrom(transactionModel, categoryName, income, expense, transactionType)).toList();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user