Skip to content

jpa

A type-safe named query design approach for JPA

[fullwidth menu_anchor=”” backgroundcolor=”” backgroundimage=”” backgroundrepeat=”no-repeat” backgroundposition=”left top” backgroundattachment=”scroll” bordersize=”0px” bordercolor=”” paddingTop=”20px” paddingBottom=”20px”] The starting point In a JEE you normally use the Java-Persistence-API JPA to access the data. JPA provides named queries which are statically defined queries with an unmodifiable query string. Because the query string is unmodifiable a client must still be able to provide parameters that concretize a query. Those query parameters are placed in the query string in a special format, e.g. :username. So if we define a named query in the simplest way it will look like this: @Entity @NamedQueries( { @NamedQuery( name = “findOrdersByUsername”, query = “select distinct o from Order o JOIN order.user AS… Read More »A type-safe named query design approach for JPA

GDPR Cookie Consent with Real Cookie Banner