Junior — Middle
Can you name popular ORM implementations used in Java projects?
sobes.tech AI
Answer from AI
The following ORM (Object-Relational Mapping) implementations are popular in Java projects:
- Hibernate — one of the most widespread and powerful ORM libraries, supporting many databases and complex mappings.
- EclipseLink — an implementation of the JPA specification from the Eclipse Foundation, often used in enterprise applications.
- MyBatis — although not a classic ORM, but rather a SQL Mapping Framework, often used for flexible SQL query management.
- Spring Data JPA — a wrapper over JPA/Hibernate, simplifying work with repositories and queries.
Example of using Hibernate with JPA:
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
// getters and setters
}
// In the service
User user = entityManager.find(User.class, 1L);