虽然我尝试执行以下代码, 我收到UnableToCreateStatementException异常,原因是:
java.sql.SQLException:参数索引超出范围(11>参数数量,即10)。
@SqlUpdate(
"update vehicle_pre_inspection set "
+ "`trip_type`=:trip_type,"
+ "`trip_id`=:trip_id,"
+ "`is_container_sealed`=:is_container_sealed,"
+ "`hidden_lock_present`=:hidden_lock_present,"
+ "`tarpaulin_present`=:tarpaulin_present,"
+ "`cargonet_hooks_present`=:cargonet_hooks_present, "
+ "`floor_tarpaulin_present =:floor_tarpaulin_present`,"
+ "`ceiling_tarpaulin_present=:ceiling_tarpaulin_present`,"
+ "`task_id`=:task_id, "
+ "`last_updated_at`= :lastUpdatedAt, "
+ "`last_updated_by_id`= :lastUpdatedById "
+ " where `id` = :id ")
void update(
@Bind("trip_type") String trip_type,
@Bind("trip_id") Long trip_id,
@Bind("is_container_sealed") Boolean is_container_sealed,
@Bind("hidden_lock_present") Boolean hidden_lock_present,
@Bind("tarpaulin_present") Boolean tarpaulin_present,
@Bind("cargonet_hooks_present") Boolean cargonet_hooks_present,
@Bind("floor_tarpaulin_present") Boolean floor_tarpaulin_present,
@Bind("ceiling_tarpaulin_present") Boolean ceiling_tarpaulin_present,
@Bind("task_id") Long task_id,
@Bind("lastUpdatedAt") Long lastUpdatedAt,
@Bind("lastUpdatedById") Long lastUpdatedById,
@Bind("id") Long id);
答案 0 :(得分:1)
检查以下行:
+“ floor_tarpaulin_present =:floor_tarpaulin_present
,”
和
+“ ceiling_tarpaulin_present=:ceiling_tarpaulin_present
”
闭合的克拉(`)出现在错误的位置。