Skip to main content

Posts

Showing posts with the label MySQL

Component Mapping in Hibernate Using Annotations

Component Mapping in Hibernate Using Annotations For explanation watch video:: Directory Structure pom.xml <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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.test</groupId> <artifactId>ComponentMapping</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>ComponentMapping</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.9</maven.compiler.source> <maven.compiler.target>1.9</maven.compiler.target> </properties> <dependencies> <dependency> <groupId&g

Hibernate – save image into database | save files into database using hibernate

how to save image and files into database using hibernate For Explanation watch video:: Directory Structure: pom.xml <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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.test</groupId> <artifactId>ImgFile</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>ImgFile</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.9</maven.compiler.source> <maven.compiler.target>1.9</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>junit&

hibernate crud example in eclipse

 hibernate crud example in eclipse For Explanation Watch video: pom.xml <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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.test</groupId> <artifactId>HibernateCrud</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>HibernateCrud</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.9</maven.compiler.source> <maven.compiler.target>1.9</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactI

spring boot project | spring boot crud web application | Spring Boot Simple Project

 spring boot crud web application 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.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> &l

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&

Collection Mapping Spring Data Jpa | JPA Collection Mapping

 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.ElementCollection; import jav