使用Criteria API和Hibernate,可以轻松便捷地搜索具有某些属性的对象(通过示例查询)。例如:
Address address = new Address();
address.setCountryISO2Code("US");
address.setCity("CHICAGO");
// more properties ...
Example addressExample = Example.create(address);
Criteria criteria =
session.createCriteria(Address.class).add(addressExample);
listAddresses(criteria.list());
我的问题是如何在JDOQL中复制它(使用DataNucleus)?