java错误:不一致的数据类型:预期数量为二进制

java错误:不一致的数据类型:预期数量为二进制,java,oracle,Java,Oracle,我在java项目中遇到了这个错误。你能帮帮我吗?Db是一个预言家。我认为我设置了正确的值,但是,我一次又一次地得到这个错误。哪一排有问题我不明白。我多次更改值并尝试,但不幸的是,它没有指出哪一行是错误的 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:0

我在java项目中遇到了这个错误。你能帮帮我吗?Db是一个预言家。我认为我设置了正确的值,但是,我一次又一次地得到这个错误。哪一排有问题我不明白。我多次更改值并尝试,但不幸的是,它没有指出哪一行是错误的

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   
SemesterBeginingOperations课程:

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 + "]";
    }

}

这通常是由一个已知问题引起的,即数据库列被定义为一个数字,但试图在其中插入null。如果您使用的是整数值,请确保它们已初始化为实际值且不为null


这可能是这里的问题,但很难区分,因为方法的名称和数据库列的名称不匹配,并且很难交叉检查所有值是否已初始化。

能否显示SemesterBeginingOperations的代码i假设否:(为“快速”修复尝试在新数据库中创建表以确保不会丢失数据。使所有数字字段为空,并在代码中注释掉所有内容。然后运行代码,每次运行注释1行。当代码中断时,您会发现culprit@foton7如果你不能向我们展示t的其余部分,帮助我们将是非常困难的,甚至是不可能的代码。最好的办法是使用调试器运行代码,并查看代码实际引发异常的位置。@mwarren在这一行中,它引发异常:semesterBeginingOperationsRepository.create(data);