Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Polymorphic Query and Cartesian Product

In the Hibernate User Guide, at example "Example 182. Join Table polymorphic query" there is a note

Polymorphic queries can create Cartesian Products, so caution is advised.

Could someone explain how the Cartesian Products might happen in a such a use case?

like image 215
Andrei Amarfii Avatar asked Jan 21 '26 17:01

Andrei Amarfii


1 Answers

It's not a correct statement. I created the HHH-11175 Jira issue, and I'm going to fix it.

I'm going to change that phrase to:

The joined table inheritance polymorphic queries can use several JOINS which might affect performance when fetching a large number of entities.

like image 150
Vlad Mihalcea Avatar answered Jan 24 '26 07:01

Vlad Mihalcea