Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

JPA/Hibernate has moved on a lot from the church-of-XML days. The basics are a lot smoother, with annotations and sensible defaults and so on, and there are some pretty nice additions.

My favourite neglected feature is JPQL with constructor expressions, which lets you write queries in an SQL-like language, but in terms of objects rather than tables, which is slightly easier, and materialise results directly into objects of your choice.



I don’t see the point of using an SQL like language instead of actual SQL unless you need to support multiple different RDBMSs.


One of the nicer JPQL features is being able to navigate the Java object model and have that translated to the equivalent joins in SQL.

However, there are things that JPQL can’t do, but it’s easy enough to create a native SQL query and have its results map to JPA entities. I use Spring Boot (JPA, Spring Data, Spring Data REST) for the sheer convenience of it and speed of development, not to abstract away the database, which is always PostgreSQL. I am very comfortable writing SQL queries and making use of PostgreSQL-specific features and Spring Boot with JPA certainly lets me do that when I want to.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: