在Customer
该Address
对象@Embedded
内部有一个对象和一个Customer
对象。Address
有场USState
也Customer
有场name
。
当customers?name=Bob
构造一个Example对象new Customer("name", null, null)
但构造customers?USState=IL
错误时,将构造Example对象:new Customer(null, null, null)
而不是new Customer(null, null, new Address(null, null, "IL", null))
。
@Embedded
假设字段名称Address
与任何字段名称都不冲突,如何说服Spring Boot识别对象属性的URL查询Customer
?
请尝试customers?addressUSState=IL
考虑您的Customer对象上的Address对象具有一个名称为address的字段。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句