有没有办法在 JAXB 和/或 SimpleXML 中处理本机查询?我正在寻找类似于JPA Named Queries的东西。
在我们的环境中,我们希望为 JAXB、SimpleXML 和 JPA 提供相同的查询 API。
我知道有
jaxbContext.getValueByXPath(customer, "@id", null, Integer.class);
但我需要获取多个具有特定值的属性的对象。
最好在 JPA/SimpleXML 中归档这样的内容:
@NamedQuery(name="orderFromCountry", query="SELECT o FROM Order o where o.address like :address")