Re: [hibernate-dev] 5.2 Java 8 Optional support

2016-05-05 Thread Vlad Mihalcea
Hi, I agree that Optional should not be used for entity attributes. Nevertheless, they can still use it for getters if they use field-based access: http://stackoverflow.com/questions/24975813/hibernate-orm-supporting-java-1-8-optional-for-persistence As for the Session-level API, we could add th

Re: [hibernate-dev] 5.2 Java 8 Optional support

2016-05-04 Thread Steve Ebersole
Good point about the design/intention of Optional. I hadn't seen that before. I included it here because I have seen requests for it. Serializability is not an argument for me. Yes *if* you plan on detaching the model and passing it remotely Serializable is a requirement and Optional could not

Re: [hibernate-dev] 5.2 Java 8 Optional support

2016-05-04 Thread Andrej Golovnin
Hi Steve, > 1. Support models which define attributes using Optional -1. Why: 1. JPA 2.1 Spec. ยง2.1 The Entity Class: If an entity instance is to be passed by value as a detached object (e.g., through a remote interface), the entity class must implement the Serializable interface.

[hibernate-dev] 5.2 Java 8 Optional support

2016-05-04 Thread Steve Ebersole
Since 5.2 is moving to baseline on Java 8 we've been looking at Java 8 features we might leverage in Hibernate and allow users to leverage. The first one I am tackling is "support for Optional", which will have the following parts: 1. Support models which define attributes using Optional 2.