Skip to content

Commit

Permalink
Table name changed due to syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
ituitis20-karadagd20 committed Dec 10, 2023
1 parent 4382fe0 commit b43bcfa
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;

@SpringBootApplication
public class EhayvanBackendApiApplication {
public static void main(String[] args) {
SpringApplication.run(EhayvanBackendApiApplication.class, args);
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import jakarta.persistence.*;

@Entity
@Table(name = "User")
public class User {
@Table(name = "Customer")
public class Customer {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int UserID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class PetOwner{
private int PetOwnerID;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "UserID", referencedColumnName = "UserID")
private User User;
private Customer User;
@OneToMany(mappedBy = "PetOwnerID")
private List<Pet> Pets;
@ManyToOne
Expand All @@ -27,10 +27,10 @@ public int getPetOwnerID() {
public void setPetOwnerID(int petOwnerID) {
PetOwnerID = petOwnerID;
}
public com.production.ehayvanbackendapi.Entities.User getUser() {
public com.production.ehayvanbackendapi.Entities.Customer getUser() {
return User;
}
public void setUser(com.production.ehayvanbackendapi.Entities.User user) {
public void setUser(com.production.ehayvanbackendapi.Entities.Customer user) {
User = user;
}
public List<Pet> getPets() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class UserType {
@Column(nullable = false)
private String Type;
@OneToMany(mappedBy = "UserTypeID")
private List<User> Users;
private List<Customer> Users;

public int getUserTypeID() {
return UserTypeID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Veterinarian{
private String Clinic;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "UserID", referencedColumnName = "UserID")
private User User;
private Customer User;
@OneToMany(mappedBy = "VetID")
private List<Appointment> Appointments;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.production.ehayvanbackendapi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;

@SpringBootApplication(exclude = { SecurityAutoConfiguration.class })
public class SpringBootSecurityApplication {

public static void main(String[] args) {
SpringApplication.run(SpringBootSecurityApplication.class, args);
}
}

0 comments on commit b43bcfa

Please sign in to comment.