Posts

Showing posts from October, 2015

JPA 2.1 – Features every developer should know

Features and Enhancements in JPA 2.1 Named Stored Procedure Query Sometimes it is easier or more efficient to use a stored procedure to perform the operations within the database. Before JPA 2.1 the only way to call a stored procedure was to use a native query. The newly introduced  @NamedStoredProcedureQuery  can now be used to annotate a query to call the stored procedure.  more details in  How to call stored procedures in JPA . Stored Procedure Query The Stored Procedure Query is an alternative way to implement a stored procedure call without using annotations. For this purpose the  EntityManager  was extended by the  createStoredProcedureQuery(String procedureName, Class… resultClasses)  method. You can read more about it in  How to call stored procedures in JPA – Part 2 . Attribute Converter Attribute Converter provide a nice and easy way to define a custom mapping between your property on the entity and the database column. The only thing that is needed is a