Setting up a Maven dependency for JPA

In this example, we will use the EclipseLink (https://eclipse.org/eclipselink/) JPA implementation. We will use the MySQL JDBC driver and Bean Validation framework for validating members of entities. Finally, we will use Java annotations provided by JSR0250. So, let's add Maven dependencies for all these:

      <dependency> 
        <groupId>org.eclipse.persistence</groupId> 
        <artifactId>eclipselink</artifactId> 
        <version>2.5.2</version> 
      </dependency> 
      <dependency> 
        <groupId>mysql</groupId> 
        <artifactId>mysql-connector-java</artifactId> 
        <version>5.1.34</version> 
      </dependency> 
      <dependency> 
        <groupId>javax.validation</groupId> 
        <artifactId>validation-api</artifactId> 
        <version>1.1.0.Final</version> 
      </dependency> 
      <dependency> 
        <groupId>javax.annotation</groupId> 
        <artifactId>jsr250-api</artifactId> 
        <version>1.0</version> 
      </dependency> 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.72.15