top | item 36503105

(no title)

andretti1977 | 2 years ago

I come from Java and moved to nodejs for backend four years ago. I now use sequelize as orm. Most of your pain is due to hibernate itself. It may be the only really enterprise level orm but it is a pain in the ass.

Sequelize is extremely simpler and writing code with it is a joy compared to hibernate.

When you say nobody uses different database that’s true 99% of the time but i worked with a company which developed a tool that must be placed within customer infrastructure and this type of customers force you for the db choice since they have highly paid db support teams (financial sector) so they had to support multiple dbs.

A year ago i had to develop a big Java application without orm (cto’s choice): i didn’t remember how tedious, error prone and slow is development without orm!!! Never do it again!

I think the best approach is to use orm for common crud tasks and add specific sql queries when things get a little bit complicated.

discuss

order

BiteCode_dev|2 years ago

Yes, starting with Hibernate as a idea of what ORM provides is terrible.

ORM have plenty of flaws, but it's like buying screws on wish and saying using a screwdriver is a terrible experience.

bzzzt|2 years ago

Hibernate is not that bad. The problem with ORMs in the Java web space is lots of people used them as an 'extreme DRY' solution to link database 'objects' to the front-end which breaks separation of concerns and forces you to use the same model or resort to ugly hacks for further mapping. In a properly separated application it works fine.

ragnese|2 years ago

> A year ago i had to develop a big Java application without orm (cto’s choice): i didn’t remember how tedious, error prone and slow is development without orm!!! Never do it again!

To be fair, JDBC is an awful, awful, API. In a sane language, with a sane SQL API/library, there's really no reason you shouldn't be able to just pull out a statically typed tuple (with proper handling of NULL, unlike JDBC) from a query result in one line.