Closed gavinking closed 1 year ago
What happens when both loadGraph and fetchGraph are provided? If we only allow one then
with(EntityGraph eg, EntityGraphLoadType loadOrFetch)
What happens when both loadGraph and fetchGraph are provided?
Well, what happens today if you specify both hints? The semantics should be the same, I guess.
[P.S. Please compare this to #415 which has slightly different naming conventions.]
What happens when both loadGraph and fetchGraph are provided?
Well, what happens today if you specify both hints? The semantics should be the same, I guess.
Correct, that semantic should be defined or be made explicit. It does not make sense to have both of them and the behaviour is presently undefined.
I'd like to change the proposal though to reverse the parameter order
with(EntityGraphLoadType loadOrFetch, EntityGraph eg)
So when people code it
.with(FETCH, myEntityGraph)
.with(LOAD, myEntityGraph);
And explicitly state to prevent ambiguity that the later of the two with
will win.
So that makes perfect sense, but personally I find it really quite a lot less ergonomic. IDEs do a somewhat better job of completing enum values than in the past, but even so I really find that they still get in the way and disrupt my "flow" when I'm typing this kind of code.
Draft proposal for a new
Finder
interface allowing typesafe passing of caching and locking options and anEntityGraph
.see #383