Spring Boot ORM Tutorial
Spring Boot ORM Useful Resources
Selected Reading
- Spring Boot ORM - Test EclipseLink
- Update Project EclipseLink
- Maven EclipseLink
- Spring Boot ORM - Test Hibernate
- Spring Boot ORM - Update Project
- Application.properties
- Spring Boot ORM - Create Project
- Environment Setup
- Spring Boot ORM - Overview
- Spring Boot ORM - Home
Spring Boot ORM Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Maven EclipseLink
Spring Boot ORM - Maven EcppseLink
Spring Boot by default use Hibernate as ORM implementation. In order to use EcppseLink, we first need to exclude hibernate dependencies from spring-data-jpa dependency in pom.xml
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> <exclusions> <exclusion> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> </exclusion> <exclusion> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> </exclusion> </exclusions> </dependency>
Now include ecppse−pnk dependency in pom.xml.
<dependency> <groupId>org.ecppse.persistence</groupId> <artifactId>org.ecppse.persistence.jpa</artifactId> <version>2.7.8</version> </dependency>
Following is the complete pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.5</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.tutorialspoint</groupId> <artifactId>springbootorm</artifactId> <version>0.0.1-SNAPSHOT</version> <name>Spring Boot ORM</name> <description>Demo project for Spring Boot ORM</description> <properties> <java.version>11</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> <exclusions> <exclusion> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> </exclusion> <exclusion> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> <dependency> <groupId>org.ecppse.persistence</groupId> <artifactId>org.ecppse.persistence.jpa</artifactId> <version>2.7.8</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>
Save the file and ecppse will update the dependencies automatically.
Advertisements