3 ms·
A little bit of a tangent but just out of curiosity, what would be your preferred option for persistence?
by davnicwil 6y ago
A little bit of a tangent but just out of curiosity, what would be your preferred option for persistence?
- vips7L 6y agoJPA is just starting to show it's years. The standard hasn't kept up. For me personally, I'd like to see something like EntityFramework, but in Java. No annotation hell, linq queries are amazing too. I know a lot of people are moving to just using jOOQ as well.
- thom 6y agoThis is interesting to me because on the whole I feel like I was doing way more interesting things in Hibernate 15 years ago than I see people doing with ORMs today (batching, dictionaries with entity keys, custom type serializers etc). Linq is lovely of course but I’m intrigued to hear what other ways you feel the industry has moved on in this area.
- vips7L 6y agoUpserting, typesafe queries instead of raw strings, disconnecting my domain model from jpa, disconnecting my domain model from validation etc. It's also really difficult to use an EntityManager outside of a JEE/Spring/framework container. They're not thread safe and you have to manage their lifetimes manually.
- gwittel 6y agoNot the OP, but I generally prefer JDBI for persistence in Java. Much less random glue/boilerplate vs Hibernate. It doesn't seem to have an official Quarkus integration, but you can just pull it in like any other dependency.
- cmckn 6y agoSame, I just write my own SQL and row mappers. It's not a huge deal, and then I actually know what the schema looks like (and why queries are slow ;). Hibernate has way too much magic going on under the covers. I have loved Dropwizard in the past, which encourages the use of Liquibase. Not right for every project, but it was great when it fit.
- reactor 6y agoMy preferred option is JDBI (from someone who used Hibernate, JdbcTemplate(Spring), QueryDSL, MyBatis at work).
- cel1ne 6y agoJDBI.
- pjmlp 6y agomyBatis
- cfontes 6y agoJDBC Template would be way better or something simple like SpringData