Skip to main content

Posts

Showing posts with the label Spring data jpa

Spring Boot MongoDB CRUD example

 Spring Boot MongoDB CRUD example About Us : Introducing the RealNameHidden: Your Ultimate Guide to Java, Spring Boot, Hibernate, Databases, Problem Solving, and Interview Questions! Are you passionate about Java programming and eager to expand your knowledge in the world of software development? Look no further! Welcome to the realm of RealNameHidden, your go-to destination for all things related to Java, Spring Boot, Hibernate, Databases, Problem Solving, and Interview Questions. With a wealth of experience and expertise in the field, RealNameHidden is a dedicated YouTuber committed to sharing valuable insights, practical tips, and in-depth tutorials to help you master the intricacies of Java programming and its associated technologies. Whether you're a beginner taking your first steps into the programming world or an experienced developer seeking advanced concepts, this channel is designed to cater to all skill levels. RealNameHidden understands that Java programming is at the h...

Many-to-Many Relationship in Spring Boot Data JPA

 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> <propertie...

Many-to-One Relationship in Spring Boot Data JPA

 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> <properties...

One-to-Many Relationship in Spring Boot Data JPA

 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

 One-to-One Relationship in Spring Boot Data JPA For Explanation watch video : 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>...

Spring Boot With H2 Database

 h2 database spring boot For explanation watch video: 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>SpringBootH2DB</artifactId> <version>0.0.1-SNAPSHOT</version> <name>SpringBootH2DB</name> <description>Demo project for Spring Boot</description> <properties> <java.v...

Custom Queries with Spring Data JPA’s @Query Annotation

 Custom Queries with Spring Data JPA’s @Query Annotation For explanation watch video : 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.4</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.app</groupId> <artifactId>SpringBootDataJPASelect</artifactId> <version>0.0.1-SNAPSHOT</version> <name>SpringBootDataJPASelect</name> <description>Demo project for Spring Boot...

Custom Non-Select Queries with Spring Data JPA’s @Query , @Modifying , @Transactional Annotations

 Custom Non-Select Queries with Spring Data JPA’s @Query , @Modifying , @Transactional Annotations For Explanation watch video: Directory Structure application.properties #datasource properties 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=update SpringBootDataJpaNonSelectApplication package com.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringBootDataJpaNonSelectApplication { public static void main(String[] args) { SpringApplication.run(SpringBootDataJpaNonSelectApplication.class, args); } } Employee.java package com.app.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persist...