I prefer to keep custom JPQL named queries in an external file, e.g. orm.xml, rather than in the entity classes, for example:
<named-query name= "DataValue.deleteByCapabilityAndCreationtime"> <query>delete from DataValue d where d.capabilityId = :capabilityId and d.creationtime <= :creationtime </query> </named-query>
This works fine with e.g. eclipseLink and postgres, but objectDB complains with an error like:
org.xml.sax.SAXParseException; lineNumber: 524; columnNumber: 70; cvc-complex-type.2.4.a: Invalid content was found starting with element 'named-query'. One of '{"http://java.sun.com/xml/ns/persistence/orm":entity, "http://java.sun.com/xml/ns/persistence/orm":embeddable}' is expected.
Does ObjectDB support externalised named queries, if so what's the recommended way to do it?