SlideShare a Scribd company logo
2. 엔티티 매핑
(Entity Mapping)
2-2. 엔티티 매핑
2-2-4 . 식별자 자동 생성(@GeneratedValue) Part2
탑크리에듀 http://www.topcredu.co.kr/
2-2-3 임베디드 타입
(@Embedded, @AttributeOverride)
탑크리에듀 http://www.topcredu.co.kr/
<?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
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
[GenerationType.TABLE, 오라클 예제]
STS에서 File -> New -> Spring Stater Project 프로젝트 이름 : GeneratedValueTest
다음화면에서 SQL : JPA, Web : Web 선택
1. pom.xml
2-2-3 임베디드 타입
(@Embedded, @AttributeOverride)
탑크리에듀 http://www.topcredu.co.kr/
<name>GeneratedValueTest</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
2-2-3 임베디드 타입
(@Embedded, @AttributeOverride)
탑크리에듀 http://www.topcredu.co.kr/
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- JSP, JSTL 사용위해 -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
2-2-3 임베디드 타입
(@Embedded, @AttributeOverride)
탑크리에듀 http://www.topcredu.co.kr/
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<!-- DriverSpy -->
<dependency>
<groupId>org.bgee.log4jdbc-log4j2</groupId>
<artifactId>log4jdbc-log4j2-jdbc4.1</artifactId>
<version>1.16</version>
</dependency>
2-2-3 임베디드 타입
(@Embedded, @AttributeOverride)
탑크리에듀 http://www.topcredu.co.kr/
<!-- for oracle -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.1.0.7.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
2-2-3 임베디드 타입
(@Embedded, @AttributeOverride)
탑크리에듀 http://www.topcredu.co.kr/
<repositories>
<repository>
<id>oracle</id>
<name>ORACLE JDBC Repository</name>
<url>https://maven.oracle.com</url>
</repository>
</repositories>
</project>
2-2-3 임베디드 타입
(@Embedded, @AttributeOverride)
탑크리에듀 http://www.topcredu.co.kr/
spring.datasource.platform=oracle
spring.datasource.sql-script-encoding=UTF-8
spring.datasource.url=jdbc:log4jdbc:oracle:thin:@localhost:1521:onj
spring.datasource.username=test
spring.datasource.password=test
#spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.driver-class-name = net.sf.log4jdbc.sql.jdbcapi.DriverSpy
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
2. application.properties
2-2-3 임베디드 타입
(@Embedded, @AttributeOverride)
탑크리에듀 http://www.topcredu.co.kr/
#hibernate config
spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect
logging.level.jpa=DEBUG
#view
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
2-2-3 임베디드 타입
(@Embedded, @AttributeOverride)
탑크리에듀 http://www.topcredu.co.kr/
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
log4jdbc.dump.sql.maxlinelength=0
3. log4jdbc.log4j2.properties

More Related Content

PDF
50 jquery
ODP
Session 2- day 3
PDF
Feedback using Angularjs + Typescript at Serenytics
PDF
Open social for science a sciverse primer - mysimplesearch
PDF
Static Reference Analysis for GUI Objects in Android Software
PDF
Backend-driven UIs - #Pragma Conference 2016
PDF
Component-driven UIs - Mobile Era 2016
PPTX
Intro to SQL Injection
50 jquery
Session 2- day 3
Feedback using Angularjs + Typescript at Serenytics
Open social for science a sciverse primer - mysimplesearch
Static Reference Analysis for GUI Objects in Android Software
Backend-driven UIs - #Pragma Conference 2016
Component-driven UIs - Mobile Era 2016
Intro to SQL Injection

What's hot (20)

PDF
Paparazzi2
PPTX
Jsp session 3
ODP
Codegnitorppt
TXT
Able to find out apps password in r12
ODP
Day seven
PDF
Training Session 2 - Day 2
PDF
International News | World News
PDF
Different types of sticker apps
ODP
YAML is the new Eval
PPTX
How to have actionable feedback with salesforce knowledge
PPS
Patterns in Eclipse
PDF
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
PDF
Alloy Tips & Tricks #TiLon
PPTX
Extend sdk
PDF
Technology and Science News - ABC News
PPTX
20. CodeIgniter edit images
PDF
Technology and Science News - ABC News
PPTX
IOS Storyboards
PDF
Oto Brglez - Tips for better tests
PDF
Politics News and U.S. Elections Coverage
Paparazzi2
Jsp session 3
Codegnitorppt
Able to find out apps password in r12
Day seven
Training Session 2 - Day 2
International News | World News
Different types of sticker apps
YAML is the new Eval
How to have actionable feedback with salesforce knowledge
Patterns in Eclipse
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
Alloy Tips & Tricks #TiLon
Extend sdk
Technology and Science News - ABC News
20. CodeIgniter edit images
Technology and Science News - ABC News
IOS Storyboards
Oto Brglez - Tips for better tests
Politics News and U.S. Elections Coverage
Ad

More from 탑크리에듀(구로디지털단지역3번출구 2분거리) (20)

PDF
자마린.안드로이드 기본 내장레이아웃(Built-In List Item Layouts)
PDF
(스프링프레임워크 강좌)스프링부트개요 및 HelloWorld 따라하기
PDF
자마린 iOS 멀티화면 컨트롤러_네비게이션 컨트롤러, 루트 뷰 컨트롤러
PPTX
[IT교육/IT학원]Develope를 위한 IT실무교육
PPTX
[아이오닉학원]아이오닉 하이브리드 앱 개발 과정(아이오닉2로 동적 모바일 앱 만들기)
PPTX
[뷰제이에스학원]뷰제이에스(Vue.js) 프로그래밍 입문(프로그레시브 자바스크립트 프레임워크)
PPTX
[씨샵학원/씨샵교육]C#, 윈폼, 네트워크, ado.net 실무프로젝트 과정
PPTX
[정보처리기사자격증학원]정보처리기사 취득 양성과정(국비무료 자격증과정)
PPTX
[wpf학원,wpf교육]닷넷, c#기반 wpf 프로그래밍 인터페이스구현 재직자 향상과정
PDF
(WPF교육)ListBox와 Linq 쿼리를 이용한 간단한 데이터바인딩, 새창 띄우기, 이벤트 및 델리게이트를 통한 메인윈도우의 ListB...
PDF
[자마린교육/자마린실습]자바,스프링프레임워크(스프링부트) RESTful 웹서비스 구현 실습,자마린에서 스프링 웹서비스를 호출하고 응답 JS...
PPTX
[구로자마린학원/자마린강좌/자마린교육]3. xamarin.ios 3.3.5 추가적인 사항
PPTX
3. xamarin.i os 3.3 xamarin.ios helloworld 자세히 살펴보기 3.4.4 view controllers an...
PPTX
5. 서브 쿼리(sub query) 5.1 서브 쿼리(sub query) 개요 5.2 단일행 서브쿼리(single row sub query)
PPTX
3. xamarin.i os 3.1 xamarin.ios 설치, 개발환경 3.2 xamarin.ios helloworld(단일 뷰) 실습[...
PDF
(닷넷,자마린,아이폰실습)Xamarin.iOS HelloWorld 실습_멀티화면,화면전환_Xamarin교육/Xamarin강좌
PPTX
C#기초에서 윈도우, 스마트폰 앱개발 과정(c#.net, ado.net, win form, wpf, 자마린)_자마린학원_씨샵교육_WPF학원...
PPTX
자바, 웹 기초와 스프링 프레임워크 & 마이바티스 재직자 향상과정(자바학원/자바교육/자바기업출강]
PPTX
3. xamarin.i os 3.1 xamarin.ios 설치, 개발환경 3.2 xamarin.ios helloworld_자마린학원_자마린...
PPTX
3. 안드로이드 애플리케이션 구성요소 3.2인텐트 part01(안드로이드학원/안드로이드교육/안드로이드강좌/안드로이드기업출강]
자마린.안드로이드 기본 내장레이아웃(Built-In List Item Layouts)
(스프링프레임워크 강좌)스프링부트개요 및 HelloWorld 따라하기
자마린 iOS 멀티화면 컨트롤러_네비게이션 컨트롤러, 루트 뷰 컨트롤러
[IT교육/IT학원]Develope를 위한 IT실무교육
[아이오닉학원]아이오닉 하이브리드 앱 개발 과정(아이오닉2로 동적 모바일 앱 만들기)
[뷰제이에스학원]뷰제이에스(Vue.js) 프로그래밍 입문(프로그레시브 자바스크립트 프레임워크)
[씨샵학원/씨샵교육]C#, 윈폼, 네트워크, ado.net 실무프로젝트 과정
[정보처리기사자격증학원]정보처리기사 취득 양성과정(국비무료 자격증과정)
[wpf학원,wpf교육]닷넷, c#기반 wpf 프로그래밍 인터페이스구현 재직자 향상과정
(WPF교육)ListBox와 Linq 쿼리를 이용한 간단한 데이터바인딩, 새창 띄우기, 이벤트 및 델리게이트를 통한 메인윈도우의 ListB...
[자마린교육/자마린실습]자바,스프링프레임워크(스프링부트) RESTful 웹서비스 구현 실습,자마린에서 스프링 웹서비스를 호출하고 응답 JS...
[구로자마린학원/자마린강좌/자마린교육]3. xamarin.ios 3.3.5 추가적인 사항
3. xamarin.i os 3.3 xamarin.ios helloworld 자세히 살펴보기 3.4.4 view controllers an...
5. 서브 쿼리(sub query) 5.1 서브 쿼리(sub query) 개요 5.2 단일행 서브쿼리(single row sub query)
3. xamarin.i os 3.1 xamarin.ios 설치, 개발환경 3.2 xamarin.ios helloworld(단일 뷰) 실습[...
(닷넷,자마린,아이폰실습)Xamarin.iOS HelloWorld 실습_멀티화면,화면전환_Xamarin교육/Xamarin강좌
C#기초에서 윈도우, 스마트폰 앱개발 과정(c#.net, ado.net, win form, wpf, 자마린)_자마린학원_씨샵교육_WPF학원...
자바, 웹 기초와 스프링 프레임워크 & 마이바티스 재직자 향상과정(자바학원/자바교육/자바기업출강]
3. xamarin.i os 3.1 xamarin.ios 설치, 개발환경 3.2 xamarin.ios helloworld_자마린학원_자마린...
3. 안드로이드 애플리케이션 구성요소 3.2인텐트 part01(안드로이드학원/안드로이드교육/안드로이드강좌/안드로이드기업출강]
Ad

Recently uploaded (20)

PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
RMMM.pdf make it easy to upload and study
PPTX
Cell Types and Its function , kingdom of life
PDF
Sports Quiz easy sports quiz sports quiz
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Basic Mud Logging Guide for educational purpose
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
Institutional Correction lecture only . . .
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Lesson notes of climatology university.
PDF
Anesthesia in Laparoscopic Surgery in India
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Final Presentation General Medicine 03-08-2024.pptx
RMMM.pdf make it easy to upload and study
Cell Types and Its function , kingdom of life
Sports Quiz easy sports quiz sports quiz
FourierSeries-QuestionsWithAnswers(Part-A).pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Supply Chain Operations Speaking Notes -ICLT Program
STATICS OF THE RIGID BODIES Hibbelers.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
O7-L3 Supply Chain Operations - ICLT Program
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Basic Mud Logging Guide for educational purpose
PPH.pptx obstetrics and gynecology in nursing
Institutional Correction lecture only . . .
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Computing-Curriculum for Schools in Ghana
Lesson notes of climatology university.
Anesthesia in Laparoscopic Surgery in India

2. 엔티티 매핑(entity mapping) 2 2 엔티티매핑 2-2-4. 식별자 자동 생성(@generated-value) part2

  • 1. 2. 엔티티 매핑 (Entity Mapping) 2-2. 엔티티 매핑 2-2-4 . 식별자 자동 생성(@GeneratedValue) Part2 탑크리에듀 http://www.topcredu.co.kr/
  • 2. 2-2-3 임베디드 타입 (@Embedded, @AttributeOverride) 탑크리에듀 http://www.topcredu.co.kr/ <?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> [GenerationType.TABLE, 오라클 예제] STS에서 File -> New -> Spring Stater Project 프로젝트 이름 : GeneratedValueTest 다음화면에서 SQL : JPA, Web : Web 선택 1. pom.xml
  • 3. 2-2-3 임베디드 타입 (@Embedded, @AttributeOverride) 탑크리에듀 http://www.topcredu.co.kr/ <name>GeneratedValueTest</name> <description>Demo project for Spring Boot</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.1.RELEASE</version> <relativePath /> <!-- lookup parent from repository --> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency>
  • 4. 2-2-3 임베디드 타입 (@Embedded, @AttributeOverride) 탑크리에듀 http://www.topcredu.co.kr/ <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <!-- JSP, JSTL 사용위해 --> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency> <dependency>
  • 5. 2-2-3 임베디드 타입 (@Embedded, @AttributeOverride) 탑크리에듀 http://www.topcredu.co.kr/ <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> <scope>provided</scope> </dependency> <!-- DriverSpy --> <dependency> <groupId>org.bgee.log4jdbc-log4j2</groupId> <artifactId>log4jdbc-log4j2-jdbc4.1</artifactId> <version>1.16</version> </dependency>
  • 6. 2-2-3 임베디드 타입 (@Embedded, @AttributeOverride) 탑크리에듀 http://www.topcredu.co.kr/ <!-- for oracle --> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.1.0.7.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
  • 7. 2-2-3 임베디드 타입 (@Embedded, @AttributeOverride) 탑크리에듀 http://www.topcredu.co.kr/ <repositories> <repository> <id>oracle</id> <name>ORACLE JDBC Repository</name> <url>https://maven.oracle.com</url> </repository> </repositories> </project>
  • 8. 2-2-3 임베디드 타입 (@Embedded, @AttributeOverride) 탑크리에듀 http://www.topcredu.co.kr/ spring.datasource.platform=oracle spring.datasource.sql-script-encoding=UTF-8 spring.datasource.url=jdbc:log4jdbc:oracle:thin:@localhost:1521:onj spring.datasource.username=test spring.datasource.password=test #spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver spring.datasource.driver-class-name = net.sf.log4jdbc.sql.jdbcapi.DriverSpy spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=create 2. application.properties
  • 9. 2-2-3 임베디드 타입 (@Embedded, @AttributeOverride) 탑크리에듀 http://www.topcredu.co.kr/ #hibernate config spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect logging.level.jpa=DEBUG #view spring.mvc.view.prefix=/WEB-INF/jsp/ spring.mvc.view.suffix=.jsp
  • 10. 2-2-3 임베디드 타입 (@Embedded, @AttributeOverride) 탑크리에듀 http://www.topcredu.co.kr/ log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator log4jdbc.dump.sql.maxlinelength=0 3. log4jdbc.log4j2.properties