简体   繁体   中英

Microservice connect Oracle database

I have an error in class domain Microservice Oracle dataBase

package hisL3.vnpt.tiepnhan.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import oracle.sql.DATE;
//import org.hibernate.annotations.Table;
import javax.persistence.Table;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Column;
import javax.persistence.Id;

@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "his_manager.tgg_quanly_lichhen")

public class Dm_bao_hiem_y_te {

    private Integer id;
    private Integer id_lichhen;
    private Integer mabenhnhan;
    private String tenbenhnhan;
    private Integer gioitinh;
    private String sodienthoai;
    private String tenbenhvien;
    private Integer songay;
    private DATE ngayhen;
    private DATE ngaythaotac;
    private Integer ngioithaotac;
    private Integer guisms;

    @Column(name = "ID_LICHHEN", insertable = false, updatable = false)
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId_lichhen() {
        return id_lichhen;
    }

    public void setId_lichhen(Integer id_lichhen) {
        this.id_lichhen = id_lichhen;
    }

    public Integer getMabenhnhan() {
        return mabenhnhan;
    }

    public void setMabenhnhan(Integer mabenhnhan) {
        this.mabenhnhan = mabenhnhan;
    }

    public String getTenbenhnhan() {
        return tenbenhnhan;
    }

    public void setTenbenhnhan(String tenbenhnhan) {
        this.tenbenhnhan = tenbenhnhan;
    }

    public Integer getGioitinh() {
        return gioitinh;
    }

    public void setGioitinh(Integer gioitinh) {
        this.gioitinh = gioitinh;
    }

    public String getSodienthoai() {
        return sodienthoai;
    }

    public void setSodienthoai(String sodienthoai) {
        this.sodienthoai = sodienthoai;
    }

    public String getTenbenhvien() {
        return tenbenhvien;
    }

    public void setTenbenhvien(String tenbenhvien) {
        this.tenbenhvien = tenbenhvien;
    }

    public Integer getSongay() {
        return songay;
    }

    public void setSongay(Integer songay) {
        this.songay = songay;
    }

    public DATE getNgayhen() {
        return ngayhen;
    }

    public void setNgayhen(DATE ngayhen) {
        this.ngayhen = ngayhen;
    }

    public DATE getNgaythaotac() {
        return ngaythaotac;
    }

    public void setNgaythaotac(DATE ngaythaotac) {
        this.ngaythaotac = ngaythaotac;
    }

    public Integer getNgioithaotac() {
        return ngioithaotac;
    }

    public void setNgioithaotac(Integer ngioithaotac) {
        this.ngioithaotac = ngioithaotac;
    }

    public Integer getGuisms() {
        return guisms;
    }

    public void setGuisms(Integer guisms) {
        this.guisms = guisms;
    }
}

Error: 在此处输入图像描述

Failed to initialize JPA EntityManagerFactory: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Repeated column in mapping for entity: hisL3.vnpt.tiepnhan.entity.Dm_bao_hiem_y_te column: id_lichhen (should be mapped with insert="false" update="false")

Connection oracle.jdbc.driver.T4CConnection@493325b4 marked as broken because of SQLSTATE(08006), ErrorCode(17002)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM