0

I am not able to create one-to-one relation JPA.

When I run the program, I am getting following error:

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AI" and "Latin1_General_BIN" in the equal to operation.

  @Entity
    @Table(name = "EMPLOYEE")
    public class Employee {

        @Column(name = "EMPID")
        @Id
        private String empid;

        @Column(name = "COMPANYID")
        private String companyid;

        @Column(name = "NAME")
        private String name;



        @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
        @JoinColumn(name = "ADDRESSID", referencedColumnName = "ADDID")
        private EmployeeCommunication empcomm;



        public Employee() {

        }
      setters and getters
     }


    @Entity
    @Table(name = "EMPLOYEECOMUNICATION")
    public class EmployeeCommunication {
        @Column(name = "ADDID")
        @Id
        private String empadid;

        @Column(name = "PHONE")
        private String phone;

        @Column(name = "EMAIL")
        private String Email;



        @OneToOne(mappedBy = "empcomm")

        private Employee employee;

        public EmployeeCommunication(){

        }

     setters and getters
}

I tried multiple ways, but I am not able to succeed.

How do I to create a one-to-one mapping using JPA and Spring-boot?

  • 2
    Have you checked this? https://stackoverflow.com/questions/1607560/cannot-resolve-the-collation-conflict-between-sql-latin1-general-cp1-ci-as-and/51956683#51956683 – RiyaGeorge Mar 21 '19 at 08:01
  • 1
    Possible duplicate of [https://stackoverflow.com/questions/13044567/hibernate-bidirectional-onetoone](https://stackoverflow.com/questions/13044567/hibernate-bidirectional-onetoone) – Naveen Kumar H S Mar 21 '19 at 08:04

0 Answers0