Skip to content

Commit

Permalink
FIX: bug/id auto-generating ids
Browse files Browse the repository at this point in the history
  • Loading branch information
ErskineTurnerDWMG committed Oct 16, 2024
1 parent 6fa2d9b commit 4d98a9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/avengers/example/domain/Account.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.avengers.example.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.Data;

Expand All @@ -9,6 +11,7 @@
public class Account
{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long acctId;
private int userType;
private String username;
Expand All @@ -20,9 +23,8 @@ public Account()
{
}

public Account(long acctId, int userType, String username, String password, String email, String phoneNumber)
public Account(int userType, String username, String password, String email, String phoneNumber)
{
this.acctId = acctId;
this.userType = userType;
this.username = username;
this.password = password;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/avengers/example/domain/Loan.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.avengers.example.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.Data;

Expand All @@ -9,6 +11,7 @@
public class Loan
{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long loanId;
private double originAmount;
private long interestRate;
Expand All @@ -17,9 +20,8 @@ public Loan()
{
}

public Loan(Long loanId, double originAmount, long interestRate)
public Loan(double originAmount, long interestRate)
{
this.loanId = loanId;
this.originAmount = originAmount;
this.interestRate = interestRate;
}
Expand Down

0 comments on commit 4d98a9d

Please sign in to comment.