-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Several Entities connected(Appointment, PetOwner, Veterinarian, Pet)
- Loading branch information
Showing
5 changed files
with
86 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package Entities; | ||
|
||
import jakarta.persistence.*; | ||
|
||
import java.util.List; | ||
|
||
@Entity | ||
@Table(name = "Pet") | ||
public class Pet { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private int PetID; | ||
private String PetName; | ||
private int Age; | ||
@ManyToOne | ||
@JoinColumn(name = "PetTypeID", referencedColumnName = "PetTypeID") | ||
private PetType PetTypeID; | ||
private String Description; | ||
@OneToMany(mappedBy = "Appointments") | ||
private List<Appointment> Appointments; | ||
|
||
public int getPetID() { | ||
return PetID; | ||
} | ||
public void setPetID(int petID) { | ||
PetID = petID; | ||
} | ||
public String getPetName() { | ||
return PetName; | ||
} | ||
public void setPetName(String petName) { | ||
PetName = petName; | ||
} | ||
public int getAge() { | ||
return Age; | ||
} | ||
public void setAge(int age) { | ||
Age = age; | ||
} | ||
public PetType getPetTypeID() { | ||
return PetTypeID; | ||
} | ||
public void setPetTypeID(PetType petTypeID) { | ||
PetTypeID = petTypeID; | ||
} | ||
public String getDescription() { | ||
return Description; | ||
} | ||
public void setDescription(String description) { | ||
Description = description; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters