From the course: Java Persistence with JPA and Hibernate
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Problems related to impedance mismatch - JPA Tutorial
From the course: Java Persistence with JPA and Hibernate
Problems related to impedance mismatch
- [Instructor] Let's try to understand what exact problems relate to the object relational impedance mismatch. One such problem relates to granularity. That is the extent to which something is composed of smaller components. In the object oriented model, a class has attributes, so a class is composed of attributes. Those attributes could even be references of other classes. In other words, classes could be composed of other classes. For instance, a book class is composed of Title, ISBN, Author and other attributes, where author itself is another class. There's a composition relationship between the book and author. In other words, we can see that the book contains an author. In the relational or database model, the levels of granularity are tables, rows, and columns. Table columns have data types, but can a type be another table? I hope you answered no. For instance, there can be an Author table, but you can't have a column data type called Author in the book table. Due to this…