Need advice about which tool to choose?Ask the StackShare community!
Doctrine 2 vs Hibernate: What are the differences?
Developers describe Doctrine 2 as "An object-relational mapper (ORM) for PHP 5.3.2+ that provides transparent persistence for PHP objects". Doctrine 2 sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. On the other hand, Hibernate is detailed as "Idiomatic persistence for Java and relational databases". Hibernate is a suite of open source projects around domain models. The flagship project is Hibernate ORM, the Object Relational Mapper.
Doctrine 2 and Hibernate can be categorized as "Object Relational Mapper (ORM)" tools.
"Great abstraction, easy to use, good docs" is the primary reason why developers consider Doctrine 2 over the competitors, whereas "Easy ORM" was stated as the key factor in picking Hibernate.
According to the StackShare community, Hibernate has a broader approval, being mentioned in 87 company stacks & 74 developers stacks; compared to Doctrine 2, which is listed in 35 company stacks and 12 developer stacks.
Pros of Doctrine 2
- Great abstraction, easy to use, good docs14
- Object-Oriented10
- Easy setup7
Pros of Hibernate
- Easy ORM19
- Easy transaction definition7
- Is integrated with spring jpa1
Sign up to add or upvote prosMake informed product decisions
Cons of Doctrine 2
Cons of Hibernate
- Can't control proxy associations when entity graph used3