0

我有一个策略类如下

@Entity

@Table(name = "Policy") 公共类 Policy {

private Long policyId;
private Long customerId;
private Long vehicleId;

@Convert(converter =LocalDateAttributeConverter.class)
private LocalDate policyStartDate;

@Convert(converter =LocalDateAttributeConverter.class)
private LocalDate policyEndDate;

@Id
@SequenceGenerator(name = "POLICYID_GEN", sequenceName = "policyId_seq", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "POLICYID_GEN")
@Column(name = "PolicyId")
public Long getPolicyId() {
    return policyId;
}

public void setPolicyId(Long policyId) {
    this.policyId = policyId;
}

@Column(name = "CustomerId")
public Long getCustomerId() {
    return customerId;
}

public void setCustomerId(Long customerId) {
    this.customerId = customerId;
}

@Column(name = "VehicleId")
public Long getVehicleId() {
    return vehicleId;
}

public void setVehicleId(Long vehicleId) {
    this.vehicleId = vehicleId;
}

@Column(name = "PolicyStartDate")
public LocalDate getPolicyStartDate() {
    return policyStartDate;
}

public void setPolicyStartDate(LocalDate policyStartDate) {
    this.policyStartDate = policyStartDate;
}

@Column(name = "PolicyEndDate")
public LocalDate getPolicyEndDate() {
    return policyEndDate;
}

public void setPolicyEndDate(LocalDate policyEndDate) {
    this.policyEndDate = policyEndDate;
}

我正在尝试使用 JPA 保持相同但低于错误

休眠:从双重策略中选择policyId_seq.nextval [policyId=1006,customerId=1,vehicleId=1,policyStartDate=2019-01-01,policyEndDate=2019-12-31] 休眠:插入策略(CustomerId,PolicyEndDate,PolicyStartDate, VehicleId, PolicyId) 值 (?, ?, ?, ?, ?) 2018 年 12 月 27 日下午 2:25:25 org.apache.catalina.core.StandardWrapperValve 调用 SEVERE:Servlet.service() for servlet [PolicyController] in context带路径 [/InsurancePortal] 抛出异常 [请求处理失败;嵌套异常是 org.springframework.dao.InvalidDataAccessResourceUsageException:ORA-00932:不一致的数据类型:预期 NUMBER 得到 BINARY;SQL [不适用];嵌套异常是 org.hibernate.exception.SQLGrammarException:ORA-00932:不一致的数据类型:预期 NUMBER got BINARY ],根本原因是 java.sql.SQLSyntaxErrorException:

4

0 回答 0