Skip to content

Commit

Permalink
Created Entity Repository
Browse files Browse the repository at this point in the history
  • Loading branch information
FruTooTi committed Dec 10, 2023
1 parent a43bc51 commit 2123a2a
Show file tree
Hide file tree
Showing 20 changed files with 102 additions and 26 deletions.
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public class Appointment {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int AppointmentID;
private Integer AppointmentID;
@ManyToOne
@JoinColumn(name = "PetOwnerID", referencedColumnName = "PetOwnerID")
private PetOwner PetOwnerID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class Customer {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int UserID;
private Integer UserID;
@Column(nullable = false)
private String Name;
@Column(nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class MedType{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int MedTypeID;
private Integer MedTypeID;
@Column(nullable = false)
private String MedType;
@OneToMany(mappedBy = "MedTypeID")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class Medication {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int medicationID;
private Integer medicationID;
@Column(nullable = false)
private String medicationName;
@ManyToOne
Expand All @@ -23,47 +23,31 @@ public class Medication {
public Pet getPetID() {
return PetID;
}

public void setPetID(Pet petID) {
PetID = petID;
}






public int getMedicationID() {
return medicationID;
}

public void setMedicationID(int medicationID) {
this.medicationID = medicationID;
}

public String getMedicationName() {
return medicationName;
}

public void setMedicationName(String medicationName) {
this.medicationName = medicationName;
}

public MedType getMedTypeID() {
return MedTypeID;
}

public void setMedTypeID(MedType medTypeID) {
MedTypeID = medTypeID;
}

public Schedule getScheduleID() {
return ScheduleID;
}

public void setScheduleID(Schedule scheduleID) {
ScheduleID = scheduleID;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class Pet {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int PetID;
private Integer PetID;
private String PetName;
private int Age;
@ManyToOne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class PetOwner{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int PetOwnerID;
private Integer PetOwnerID;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "UserID", referencedColumnName = "UserID")
private Customer User;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class PetType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int PetTypeID;
private Integer PetTypeID;
@Column(nullable = false)
private String Type;
@OneToMany(mappedBy = "PetTypeID")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class UserType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int UserTypeID;
private Integer UserTypeID;
@Column(nullable = false)
private String Type;
@OneToMany(mappedBy = "UserTypeID")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class Veterinarian{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int VetID;
private Integer VetID;
@OneToMany(mappedBy = "Vet")
private List<PetOwner> PetOwners;
@Column(nullable = false)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.production.ehayvanbackendapi.Repositories;

import com.production.ehayvanbackendapi.Entities.Appointment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface AppointmentRepository extends JpaRepository<Appointment, Integer> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.production.ehayvanbackendapi.Repositories;

import com.production.ehayvanbackendapi.Entities.Customer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface CustomerRepository extends JpaRepository<Customer, Integer> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.production.ehayvanbackendapi.Repositories;

import com.production.ehayvanbackendapi.Entities.MedType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface MedTypeRepository extends JpaRepository<MedType, Integer> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.production.ehayvanbackendapi.Repositories;

import com.production.ehayvanbackendapi.Entities.Medication;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface MedicationRepository extends JpaRepository<Medication, Integer> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.production.ehayvanbackendapi.Repositories;

import com.production.ehayvanbackendapi.Entities.PetOwner;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface PetOwnerRepository extends JpaRepository<PetOwner, Integer> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.production.ehayvanbackendapi.Repositories;

import com.production.ehayvanbackendapi.Entities.Pet;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface PetRepository extends JpaRepository<Pet, Integer> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.production.ehayvanbackendapi.Repositories;

import com.production.ehayvanbackendapi.Entities.PetType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface PetTypeRepository extends JpaRepository<PetType, Integer> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.production.ehayvanbackendapi.Repositories;

import com.production.ehayvanbackendapi.Entities.Schedule;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface ScheduleRepository extends JpaRepository<Schedule, Integer> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.production.ehayvanbackendapi.Repositories;

import com.production.ehayvanbackendapi.Entities.UserType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface UserTypeRepository extends JpaRepository<UserType, Integer> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.production.ehayvanbackendapi.Repositories;

import com.production.ehayvanbackendapi.Entities.Veterinarian;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface VeterinarianRepository extends JpaRepository<Veterinarian, Integer> {

}

0 comments on commit 2123a2a

Please sign in to comment.