java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [typeLaw] on

jpa报错:java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [typeLaw] on this ManagedType [com.china317.kswxp.entity.IdEntity]

原因:搜索条件里面参数应该对应数据库字段,否则会报错。
前端代码:
function doVeSearch(){
$(’#vehicledata’).datagrid(‘load’,{
search_LIKE_license: $("#plateNumberLaw").val(),
search_EQ_licenseColor: $("#vehicleColorLaw").datebox(‘getValue’),
search_EQ_type: KaTeX parse error: Expected 'EOF', got '#' at position 3: ("#̲typeLaw").dateb…("#startTimeLaw").datebox(‘getValue’),
search_LTE_endTime:$("#endTimeLaw").datebox(‘getValue’)
});
}
后端代码:
Map searchParams = Servlets.getParametersStartingWith(request, “search_”);
Page alarmLawPage = vehicleKeyControlService.findBy(searchParams, pageNumber, pageSize, “”, “”);
return handleGridResult(alarmLawPage);
数据库对应字段:
CREATE TABLE vehicle_key_control (
id bigint(20) NOT NULL AUTO_INCREMENT COMMENT ‘id主键’,
license varchar(20) DEFAULT NULL COMMENT ‘车牌号’,
license_color varchar(10) DEFAULT NULL COMMENT ‘车牌颜色’,
start_time datetime DEFAULT NULL COMMENT ‘开始时间’,
end_time datetime DEFAULT NULL COMMENT ‘结束时间’,
note varchar(255) DEFAULT NULL COMMENT ‘举报内容’,
time datetime DEFAULT NULL COMMENT ‘违法时间’,
type varchar(255) DEFAULT NULL COMMENT ‘违法类型’,
points int(11) DEFAULT NULL COMMENT ‘扣分’,
penalty varchar(20) DEFAULT NULL COMMENT ‘罚款’,
description varchar(255) DEFAULT NULL COMMENT ‘违法描述’,
basis varchar(255) DEFAULT NULL COMMENT ‘参考准则’,
traffic_process_time datetime DEFAULT NULL COMMENT ‘交警处理时间’,
create_time datetime DEFAULT NULL COMMENT ‘创建时间’,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT=‘车辆重点布控’;
只有相互对应,才不会报错。

你可能感兴趣的:(框架)