ошибка Java: несовместимые типы данных: ожидается, что NUMBER получил BINARY - PullRequest
0 голосов
/ 04 октября 2019

Я получил эту ошибку в моем проекте Java. Не могли бы вы мне помочь? Дб это оракул. Я думаю, что я установил правильные значения, но, более того, я получаю эту ошибку снова и снова. В каком ряду есть проблема, которую я не понял. Я много раз менял значения и пробовал, но, к сожалению, в нем не указано, какая строка неверна?

2019-10-04 11:05:23.903  WARN 15556 --- [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 932, SQLState: 42000
2019-10-04 11:05:23.907 ERROR 15556 --- [           main] o.h.engine.jdbc.spi.SqlExceptionHelper   : ORA-00932: inconsistent datatypes: expected NUMBER got BINARY

метод создания:

@Test
public void create() throws ParseException {
    String dateInString = "31-08-1982";
    SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
    Date date7 = sdf.parse(dateInString);

    SemesterBeginningOperations data = new SemesterBeginningOperations();

    data.setDtId(6494);
    data.setAsonId(114);
    data.setCrte(date7);
    data.setStae(date7);
    data.setEnte(date7);
    data.setEage(9);
    data.setClatage(9);
    data.setPan(9);
    data.setPadealGre(9);
    data.setRessade(9);
    data.setDation(9);
    data.setDal(9);
    data.setDaa(9);
    data.setDtionta2(9);
    data.setHal(9);
    data.setHoota(9);
    data.setHoQta2(9);
    data.setDaiour(9);
    data.setDaiuota(9);
    data.setDaiAuota2(9);
    data.setPrevId(183);
    data.setPticctage(2);
    data.setPatlaed(2);
    data.setAntge(1);
    data.setFalPge(1);
    data.setMinit(2);
    data.setStee(1);
    data.setMinPa2(3);
    data.setMinit2(5);
    data.setMo(4);
    data.setMinPasTp(3);
    data.setPared(6);

    semesterBeginningOperationsRepository.create(data);
}

моя таблица:

 COLUMN_NAME   DATA_TYPE    NULLABLE 
    HID         NUMBER(10,0)    No          
    BID         NUMBER(10,0)    No          
    AID         NUMBER(10,0)    No          
    YTARIHI     DATE            No          
    BTARIHI     DATE            Yes         
    BITARIHI    DATE            Yes         
    SE          NUMBER(3,0)     No          
    SDE         NUMBER(3,0)     No          
    GU          NUMBER(3,0)     No          
    GR          NUMBER(3,0)     No          
    BER         NUMBER(3,0)     No          
    GN          NUMBER(4,0)     No          
    GBER        NUMBER(10,0)    No          
    GMBER       NUMBER(10,0)    No          
    GUMBER      NUMBER(10,0)    No          
    SMBER       NUMBER(10,0)    No          
    SAR         NUMBER(10,0)    No          
    SAAR        NUMBER(10,0)    No          
    GUAT        NUMBER(3,0)     No          
    GUJAN       NUMBER(3,0)     No          
    GU2         NUMBER(3,0)     No          
    ONCMID      NUMBER(10,0)    Yes         
    PARTIE      NUMBER(3,0)     No          
    BUTTU       NUMBER(3,0)     No          
    DEE         NUMBER(3,0)     No          
    FDE         NUMBER(3,0)     No          
    BUU         NUMBER(3,0)     No          
    OGRIN       NUMBER(3,0)     No              
    BUU         NUMBER(3,0)     Yes         
    BUGU        NUMBER(3,0)     Yes         
    MER         NUMBER(3,0)     Yes         
    BUP_TP      NUMBER(1,0)     No          
    PARUN       NUMBER(1,0)     No   

Класс SemesterBeginningOperations:

package prep.core.semester.definition.domain.model.semester;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
@Table(name = "HAZ_DONEM", catalog = "", schema = "DBO")
public class SemesterBeginningOperations {
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "HAZDONEMID")
    private Integer semesterId;

    @Basic(optional = false)
    @Column(name = "BOLUMID")
    private Integer departmentId;

    @Column(name = "AKADEMIKSEZONID")
    private Integer academicSeasonId;

    @Temporal(TemporalType.DATE)
    @Column(name = "YARATILISTARIHI")
    private Date createDate;

    @Column(name = "BASLAMATARIHI")
    private Date startDate;

    @Column(name = "BITISTARIHI")
    private Date endDate;

    @Column(name = "SINAV_YUZDE")
    private Integer examPercentage;

    @Column(name = "SINIFCALISMASI_YUZDE")
    private Integer classStudyPercentage;

    @Column(name = "GECME_MIN_BASARINOTU")
    private Integer passGradeMin;

    @Column(name = "GECME_MIN_FINALNOTU")
    private Integer passGradeMinFinalGrade;

    @Column(name = "BUT_MIN_BASARINOTU")
    private Integer resitMinPassGrade;

    @Column(name = "GUNLUK_PARTICIPATION")
    private Integer dailyParticipation;

    @Column(name = "GUN_TOPLAM")
    private Integer dayTotal;

    @Column(name = "GUN_TOPLAM_EKKONTENJAN")
    private Integer dayTotalAdditionalQuota;

    @Column(name = "GUN_TOPLAM_EKKONTENJAN2")
    private Integer dayTotalAdditionalQuota2;

    @Column(name = "SAAT_TOPLAM")
    private Integer hourTotal;

    @Column(name = "SAAT_TOPLAM_EKKONTENJAN")
    private Integer hourTotalAdditionalQuota;

    @Column(name = "SAAT_TOPLAM_EKKONTENJAN2")
    private Integer hourTotalAdditionalQuota2;

    @Column(name = "GUNLUK_SAAT")
    private Integer dailyHour;

    @Column(name = "GUNLUK_SAAT_EKKONTENJAN")
    private Integer dailyHourAdditionalQuota;

    @Column(name = "GUNLUK_SAAT_EKKONTENJAN2")
    private Integer dailyHourAdditionalQuota2;

    @Column(name = "ONCEKI_HAZDONEMID")
    private Integer previousSemesterId;

    @Column(name = "PARTICIPATION_YUZDE")
    private Integer participationPercentage;

    @Column(name = "BUT_GECMENOTU")
    private Integer passGradeForResit;

    @Column(name = "DEVAMSIZLIK_YUZDE")
    private Integer absensePercentage;

    @Column(name = "FINAL_YUZDE")
    private Integer finalPercentage;

    @Column(name = "BUT_MIN_FINALNOTU")
    private Integer minFinalGradeForResit;

    @Column(name = "OGRENCIGOREBILSIN")
    private Integer studentCanSee;

    @Column(name = "BUT2_MIN_BASARINOTU")
    private Integer minPassGradeForResit2;

    @Column(name = "BUT2_MIN_FINALNOTU")
    private Integer minFinalGradeForResit2;

    @Column(name = "MODUL")
    private Integer module;

    @Column(name = "BUT_GECMENOTU_HSP_TP")
    private Integer minPassGradeForResitHspTp;

    @Column(name = "PARTICIPATION_GORUNSUN")
    private Integer participationTotalDisplayed;


    public SemesterBeginningOperations() {

    }


    public SemesterBeginningOperations(Integer semesterId, Integer departmentId, Integer academicSeasonId, Date createDate,
            Date startDate, Date endDate, Integer examPercentage, Integer classStudyPercentage, Integer passGradeMin,
            Integer passGradeMinFinalGrade, Integer resitMinPassGrade, Integer dailyParticipation, Integer dayTotal,
            Integer dayTotalAdditionalQuota, Integer dayTotalAdditionalQuota2, Integer hourTotal, Integer hourTotalAdditionalQuota,
            Integer hourTotalAdditionalQuota2, Integer dailyHour, Integer dailyHourAdditionalQuota, Integer dailyHourAdditionalQuota2,
            Integer previousSemesterId, Integer participationPercentage, Integer passGradeForResit, Integer absensePercentage,
            Integer finalPercentage, Integer minFinalGradeForResit, Integer studentCanSee, Integer minPassGradeForResit2,
            Integer minFinalGradeForResit2, Integer module, Integer minPassGradeForResitHspTp, Integer participationTotalDisplayed) {
        super();
        this.semesterId = semesterId;
        this.departmentId = departmentId;
        this.academicSeasonId = academicSeasonId;
        this.createDate = createDate;
        this.startDate = startDate;
        this.endDate = endDate;
        this.examPercentage = examPercentage;
        this.classStudyPercentage = classStudyPercentage;
        this.passGradeMin = passGradeMin;
        this.passGradeMinFinalGrade = passGradeMinFinalGrade;
        this.resitMinPassGrade = resitMinPassGrade;
        this.dailyParticipation = dailyParticipation;
        this.dayTotal = dayTotal;
        this.dayTotalAdditionalQuota = dayTotalAdditionalQuota;
        this.dayTotalAdditionalQuota2 = dayTotalAdditionalQuota2;
        this.hourTotal = hourTotal;
        this.hourTotalAdditionalQuota = hourTotalAdditionalQuota;
        this.hourTotalAdditionalQuota2 = hourTotalAdditionalQuota2;
        this.dailyHour = dailyHour;
        this.dailyHourAdditionalQuota = dailyHourAdditionalQuota;
        this.dailyHourAdditionalQuota2 = dailyHourAdditionalQuota2;
        this.previousSemesterId = previousSemesterId;
        this.participationPercentage = participationPercentage;
        this.passGradeForResit = passGradeForResit;
        this.absensePercentage = absensePercentage;
        this.finalPercentage = finalPercentage;
        this.minFinalGradeForResit = minFinalGradeForResit;
        this.studentCanSee = studentCanSee;
        this.minPassGradeForResit2 = minPassGradeForResit2;
        this.minFinalGradeForResit2 = minFinalGradeForResit2;
        this.module = module;
        this.minPassGradeForResitHspTp = minPassGradeForResitHspTp;
        this.participationTotalDisplayed = participationTotalDisplayed;
    }



    public Integer getSemesterId() {
        return semesterId;
    }

    public void setSemesterId(Integer semesterId) {
        this.semesterId = semesterId;
    }

    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }

    public Integer getAcademicSeasonId() {
        return academicSeasonId;
    }

    public void setAcademicSeasonId(Integer academicSeasonId) {
        this.academicSeasonId = academicSeasonId;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Integer getExamPercentage() {
        return examPercentage;
    }

    public void setExamPercentage(Integer examPercentage) {
        this.examPercentage = examPercentage;
    }

    public Integer getClassStudyPercentage() {
        return classStudyPercentage;
    }

    public void setClassStudyPercentage(Integer classStudyPercentage) {
        this.classStudyPercentage = classStudyPercentage;
    }

    public Integer getPassGradeMin() {
        return passGradeMin;
    }

    public void setPassGradeMin(Integer passGradeMin) {
        this.passGradeMin = passGradeMin;
    }

    public Integer getPassGradeMinFinalGrade() {
        return passGradeMinFinalGrade;
    }

    public void setPassGradeMinFinalGrade(Integer passGradeMinFinalGrade) {
        this.passGradeMinFinalGrade = passGradeMinFinalGrade;
    }

    public Integer getResitMinPassGrade() {
        return resitMinPassGrade;
    }

    public void setResitMinPassGrade(Integer resitMinPassGrade) {
        this.resitMinPassGrade = resitMinPassGrade;
    }

    public Integer getDailyParticipation() {
        return dailyParticipation;
    }

    public void setDailyParticipation(Integer dailyParticipation) {
        this.dailyParticipation = dailyParticipation;
    }

    public Integer getDayTotal() {
        return dayTotal;
    }

    public void setDayTotal(Integer dayTotal) {
        this.dayTotal = dayTotal;
    }

    public Integer getDayTotalAdditionalQuota() {
        return dayTotalAdditionalQuota;
    }

    public void setDayTotalAdditionalQuota(Integer dayTotalAdditionalQuota) {
        this.dayTotalAdditionalQuota = dayTotalAdditionalQuota;
    }

    public Integer getDayTotalAdditionalQuota2() {
        return dayTotalAdditionalQuota2;
    }

    public void setDayTotalAdditionalQuota2(Integer dayTotalAdditionalQuota2) {
        this.dayTotalAdditionalQuota2 = dayTotalAdditionalQuota2;
    }

    public Integer getHourTotal() {
        return hourTotal;
    }

    public void setHourTotal(Integer hourTotal) {
        this.hourTotal = hourTotal;
    }

    public Integer getHourTotalAdditionalQuota() {
        return hourTotalAdditionalQuota;
    }

    public void setHourTotalAdditionalQuota(Integer hourTotalAdditionalQuota) {
        this.hourTotalAdditionalQuota = hourTotalAdditionalQuota;
    }

    public Integer getHourTotalAdditionalQuota2() {
        return hourTotalAdditionalQuota2;
    }

    public void setHourTotalAdditionalQuota2(Integer hourTotalAdditionalQuota2) {
        this.hourTotalAdditionalQuota2 = hourTotalAdditionalQuota2;
    }

    public Integer getDailyHour() {
        return dailyHour;
    }

    public void setDailyHour(Integer dailyHour) {
        this.dailyHour = dailyHour;
    }

    public Integer getDailyHourAdditionalQuota() {
        return dailyHourAdditionalQuota;
    }

    public void setDailyHourAdditionalQuota(Integer dailyHourAdditionalQuota) {
        this.dailyHourAdditionalQuota = dailyHourAdditionalQuota;
    }

    public Integer getDailyHourAdditionalQuota2() {
        return dailyHourAdditionalQuota2;
    }

    public void setDailyHourAdditionalQuota2(Integer dailyHourAdditionalQuota2) {
        this.dailyHourAdditionalQuota2 = dailyHourAdditionalQuota2;
    }

    public Integer getPreviousSemesterId() {
        return previousSemesterId;
    }

    public void setPreviousSemesterId(Integer previousSemesterId) {
        this.previousSemesterId = previousSemesterId;
    }

    public Integer getParticipationPercentage() {
        return participationPercentage;
    }

    public void setParticipationPercentage(Integer participationPercentage) {
        this.participationPercentage = participationPercentage;
    }

    public Integer getPassGradeForResit() {
        return passGradeForResit;
    }

    public void setPassGradeForResit(Integer passGradeForResit) {
        this.passGradeForResit = passGradeForResit;
    }

    public Integer getAbsensePercentage() {
        return absensePercentage;
    }

    public void setAbsensePercentage(Integer absensePercentage) {
        this.absensePercentage = absensePercentage;
    }

    public Integer getFinalPercentage() {
        return finalPercentage;
    }

    public void setFinalPercentage(Integer finalPercentage) {
        this.finalPercentage = finalPercentage;
    }

    public Integer getMinFinalGradeForResit() {
        return minFinalGradeForResit;
    }

    public void setMinFinalGradeForResit(Integer minFinalGradeForResit) {
        this.minFinalGradeForResit = minFinalGradeForResit;
    }

    public Integer getStudentCanSee() {
        return studentCanSee;
    }

    public void setStudentCanSee(Integer studentCanSee) {
        this.studentCanSee = studentCanSee;
    }

    public Integer getMinPassGradeForResit2() {
        return minPassGradeForResit2;
    }

    public void setMinPassGradeForResit2(Integer minPassGradeForResit2) {
        this.minPassGradeForResit2 = minPassGradeForResit2;
    }

    public Integer getMinFinalGradeForResit2() {
        return minFinalGradeForResit2;
    }

    public void setMinFinalGradeForResit2(Integer minFinalGradeForResit2) {
        this.minFinalGradeForResit2 = minFinalGradeForResit2;
    }

    public Integer getModule() {
        return module;
    }

    public void setModule(Integer module) {
        this.module = module;
    }

    public Integer getMinPassGradeForResitHspTp() {
        return minPassGradeForResitHspTp;
    }

    public void setMinPassGradeForResitHspTp(Integer minPassGradeForResitHspTp) {
        this.minPassGradeForResitHspTp = minPassGradeForResitHspTp;
    }


    public Integer getParticipationTotalDisplayed() {
        return participationTotalDisplayed;
    }


    public void setParticipationTotalDisplayed(Integer participationTotalDisplayed) {
        this.participationTotalDisplayed = participationTotalDisplayed;
    }


    @Override
    public String toString() {
        return "SemesterBeginningOperations [semesterId=" + semesterId + ", departmentId=" + departmentId
                + ", academicSeasonId=" + academicSeasonId + ", createDate=" + createDate + ", startDate=" + startDate
                + ", endDate=" + endDate + ", examPercentage=" + examPercentage + ", classStudyPercentage="
                + classStudyPercentage + ", passGradeMin=" + passGradeMin + ", passGradeMinFinalGrade="
                + passGradeMinFinalGrade + ", resitMinPassGrade=" + resitMinPassGrade + ", dailyParticipation="
                + dailyParticipation + ", dayTotal=" + dayTotal + ", dayTotalAdditionalQuota=" + dayTotalAdditionalQuota
                + ", dayTotalAdditionalQuota2=" + dayTotalAdditionalQuota2 + ", hourTotal=" + hourTotal
                + ", hourTotalAdditionalQuota=" + hourTotalAdditionalQuota + ", hourTotalAdditionalQuota2="
                + hourTotalAdditionalQuota2 + ", dailyHour=" + dailyHour + ", dailyHourAdditionalQuota="
                + dailyHourAdditionalQuota + ", dailyHourAdditionalQuota2=" + dailyHourAdditionalQuota2
                + ", previousSemesterId=" + previousSemesterId + ", participationPercentage=" + participationPercentage
                + ", passGradeForResit=" + passGradeForResit + ", absensePercentage=" + absensePercentage
                + ", finalPercentage=" + finalPercentage + ", minFinalGradeForResit=" + minFinalGradeForResit
                + ", studentCanSee=" + studentCanSee + ", minPassGradeForResit2=" + minPassGradeForResit2
                + ", minFinalGradeForResit2=" + minFinalGradeForResit2 + ", module=" + module
                + ", minPassGradeForResitHspTp=" + minPassGradeForResitHspTp + ", participationTotalDisplayed="
                + participationTotalDisplayed + "]";
    }

}

1 Ответ

0 голосов
/ 04 октября 2019

Обычно это вызвано известной проблемой, когда столбец базы данных определен как NUMBER, но при этом делается попытка вставить в него значение null. Если вы используете целочисленные значения, убедитесь, что они инициализированы к фактическому значению, и что они не равны NULL.

В этом может быть проблема, но ее трудно определить как имена методов и имена базы данных. столбцы не совпадают, и сложно проверить, что все значения были инициализированы.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...