Java Magazine, Nov/Dec 2017
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2017 44 java ee 8 dependency groupId javax persistence groupId artifactId javax persistence api artifactId version 22 version dependency Next choose the JPA implementation that you want to use As of the release of JPA 22 both EclipseLink and Hibernate have compatible implementations For the examples in this article I use EclipseLink by adding the following dependency dependency groupId org eclipse persistence groupId artifactId eclipselink artifactId version 270 version dependency If you are using a Java EE 8 compliant server such as GlassFish 5 or Payara 5 you should be able to specify a scope of provided for these dependencies in the POM file Otherwise specify the compile scope to include them in the project build Java 8 Date and Time Support Perhaps one of the most welcome new additions is support for the Java 8 Date and Time API Since the release of Java SE 8 in 2014 developers have been using workarounds to enable the use of the Date and Time API with JPA Although most workarounds are quite simple the requirement for basic support of the updated Date and Time API has been long overdue The JPA support for the Date and Time API includes the following common types java time LocalDate java time LocalTime java time LocalDateTime
You must have JavaScript enabled to view digital editions.