Skip to content

Commit

Permalink
"Column" annotations added.
Browse files Browse the repository at this point in the history
  • Loading branch information
FruTooTi committed Dec 9, 2023
1 parent 3529c04 commit 2f71ada
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/Entities/Pet.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ public class Pet {
private int PetID;
@Column(nullable = false)
private String PetName;
@Column(nullable = false)
private int Age;
@ManyToOne
@JoinColumn(name = "PetTypeID", referencedColumnName = "PetTypeID")
private PetType PetTypeID;
@Column(nullable = false)
private String Description;
@ManyToOne
@JoinColumn(name = "PetOwnerID", referencedColumnName = "PetOwnerID")
Expand Down
1 change: 1 addition & 0 deletions src/main/java/Entities/PetType.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class PetType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int PetTypeID;
@Column(nullable = false)
private String Type;
@OneToMany(mappedBy = "Pet")
private List<Pet> pets;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/Entities/Schedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ public class Schedule {
private int ScheduleID;
@OneToMany(mappedBy = "Medication")
private List<Medication> medications;
@Column(nullable = false)
private DateTimeLiteralExpression.DateTime beginningDate;
@Column(nullable = false)
private int doseFrequency;
@Column(nullable = false)
private int doseCount;

public int getScheduleID() {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/Entities/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int UserID;
@Column(nullable = false)
private String Name;
@Column(nullable = false)
private String Surname;
@Column(nullable = false)
private String Email;
@Column(nullable = false)
private String Password;
@ManyToOne
@JoinColumn(name = "UserTypeID", referencedColumnName = "UserTypeID")
Expand Down
1 change: 1 addition & 0 deletions src/main/java/Entities/UserType.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class UserType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int UserTypeID;
@Column(nullable = false)
private String Type;
@OneToMany(mappedBy = "User")
private List<User> Users;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/Entities/Veterinarian.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class Veterinarian{
private int VetID;
@OneToMany(mappedBy = "PetOwner")
private List<PetOwner> PetOwners;
@Column(nullable = false)
private String Clinic;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "UserID", referencedColumnName = "UserID")
Expand Down

0 comments on commit 2f71ada

Please sign in to comment.