Re: [hibernate-dev] Hibernate Rx: Remove Optional from API

2020-04-16 Thread Sanne Grinovero
On Thu, 16 Apr 2020 at 15:42, Steve Ebersole wrote: > > Bit off track, but since you mentioned load, etc... Take a look at the > IdentifierLoadAccess, etc variants for loading. E.g. > > interface IdentifierLoadAccess { > T getReference(Object id); > T load(Object id); > Optional load

Re: [hibernate-dev] Hibernate Rx: Remove Optional from API

2020-04-16 Thread Steve Ebersole
Bit off track, but since you mentioned load, etc... Take a look at the IdentifierLoadAccess, etc variants for loading. E.g. interface IdentifierLoadAccess { T getReference(Object id); T load(Object id); Optional loadOptional(Object id); } Granted I'm partial, but I think that's prett

Re: [hibernate-dev] Hibernate Rx: Remove Optional from API

2020-04-16 Thread Sanne Grinovero
I would agree with you all about the general sentiment against the use of Optional, but there's one use case in which I think it might make sense (although bear with me as I've never really used it much yet) : there's several methods on the standard Session and EntityManager in Hibernate ORM to fe

[hibernate-dev] Hibernate Rx: Remove Optional from API

2020-04-16 Thread Davide D'Alto
Hi, Gavin sent this PR: https://github.com/hibernate/hibernate-rx/pull/93 It removes Optional from the API, for example: CompletionStage> fetch(T association); becomes: CompletionStage fetch(T association); Is there anybody here with strong opinions about keeping Optional in the API? Thanks