Now that #36 is fixed, the default EntityGraph concept should be deprecated for removal.
Some history
default EntityGraph concept has been introduced in 2016 at the start of the project. It was already duplicating the real default EntityGraph which is defined by JPA annotations.
For example:
public class Product {
@ManyToOne(fetch = FetchType.LAZY)
private Brand brand;
@ManyToOne(fetch = FetchType.EAGER)
private Manufacturer manufacturer;
}
In this example, the real default EntityGraph is (manufacturer) because brand is marked LAZY and manufacturer is marked EAGER.
So why the hell did we duplicate an already existing and JPA standardized concept?
Let's stay on the previous example. According to JPA, if I apply an emptyEntityGraph:
using EntityGraph type LOAD, brand will be LAZY while manufacturer will be EAGER
using EntityGraph type FETCH, brand will be LAZY while manufacturer will be LAZY
Back then, ORM like hibernate were only supporting one kind of EntityGraph, the LOAD graphs. So no EntityGraph could ever remove a node from the real default EntityGraph !
Adding default EntityGraph concept allowed to workaround the lack of support for FETCH graphs.
Today
Today, JPA ORM support EntityGraph FETCH types. This is why, default EntityGraph concept should be removed from this library.
Now that #36 is fixed, the
default EntityGraph concept
should be deprecated for removal.Some history
default EntityGraph concept
has been introduced in 2016 at the start of the project. It was already duplicating thereal default EntityGraph
which is defined by JPA annotations.For example:
In this example, the
real default EntityGraph
is(manufacturer)
becausebrand
is marked LAZY andmanufacturer
is marked EAGER.So why the hell did we duplicate an already existing and JPA standardized concept?
Let's stay on the previous example. According to JPA, if I apply an empty
EntityGraph
:LOAD
,brand
will beLAZY
whilemanufacturer
will beEAGER
FETCH
,brand
will beLAZY
whilemanufacturer
will beLAZY
Back then, ORM like
hibernate
were only supporting one kind ofEntityGraph
, theLOAD
graphs. So no EntityGraph could ever remove a node from thereal default EntityGraph
!Adding
default EntityGraph concept
allowed to workaround the lack of support forFETCH
graphs.Today
Today, JPA ORM support EntityGraph
FETCH
types. This is why,default EntityGraph concept
should be removed from this library.