Posts

Showing posts with the label Spring boot

Many-to-Many Relationship in Spring Boot Data JPA

Image
  Many-to-Many Relationship in Spring Boot Data JPA For Explanation Watch video : 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.6.6</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.app</groupId> <artifactId>SpringBootManyToMany</artifactId> <version>0.0.1-SNAPSHOT</version> <name>SpringBootManyToMany</name> <description>Demo project for Spring Boot</description> <properti...

Many-to-One Relationship in Spring Boot Data JPA

Image
   Many-to-One Relationship in Spring Boot Data JPA For Explanation Watch video ::  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.6.6</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.app</groupId> <artifactId>SpringBootManyToOne</artifactId> <version>0.0.1-SNAPSHOT</version> <name>SpringBootManyToOne</name> <description>Demo project for Spring Boot</description> <properti...

One-to-Many Relationship in Spring Boot Data JPA

Image
 One-to-Many Relationship in Spring Boot Data JPA For Explanation watch video: 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.6.6</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.app</groupId> <artifactId>SpringBootOneToMany</artifactId> <version>0.0.1-SNAPSHOT</version> <name>SpringBootOneToMany</name> <description>Demo project for Spring Boot</description> <properties...

One-to-One Relationship in Spring Boot Data JPA

Image
 One-to-One Relationship in Spring Boot Data JPA Directory Structure:: 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.6.6</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.app</groupId> <artifactId>SpringBootOneToOne</artifactId> <version>0.0.1-SNAPSHOT</version> <name>SpringBootOneToOne</name> <description>Demo project for Spring Boot</description> <properties> <j...

spring boot crud web application

Image
 spring boot crud web application For Explanation Watch video : Directory  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.6.3</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.app</groupId> <artifactId>SpringBootCrud</artifactId> <version>0.0.1-SNAPSHOT</version> <name>SpringBootCrud</name> <description>Demo project for Spring Boot</description> <properties> <java....

Collection Mapping Spring Data Jpa

Image
 Collection Mapping Spring Data Jpa For Explanation Watch video: Directory Structure: application.properties #datasource spring.datasource.url=jdbc:mysql://localhost:3306/new spring.datasource.username=root spring.datasource.password=root #jpa spring.jpa.hibernate.ddl-auto=create spring.jpa.show-sql=true spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true SpringBootDataJpaCollectionMappingApplication  package com.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringBootDataJpaCollectionMappingApplication { public static void main(String[] args) { SpringApplication.run(SpringBootDataJpaCollectionMappingApplication.class, args); } } Employee  package com.app.entity; import java.util.List; import java.util.Map; import java.util.Set; import javax.persistence.CollectionTable; import javax.persistence.Column; import javax.persistence.ElementCollect...

how to create rest api using spring boot in eclipse

Image
 how to create rest api using spring boot in eclipse For Explanation Watch video : Directory application.properties:: #server port server.port=3031 #datasource spring.datasource.url=jdbc:mysql://localhost:3306/new spring.datasource.username=root spring.datasource.password=root #jpa spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=create SpringBootRestApplication  package com.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringBootRestApplication { public static void main(String[] args) { SpringApplication.run(SpringBootRestApplication.class, args); } } StudentController  package com.app.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.s...