Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- myBatis
- 배포
- 김영한
- 스파르타코딩클럽
- jQuery
- CSS
- vscode
- github
- HTML
- 기업설명회
- 웹개발
- 코딩
- restapi
- java
- SQLD
- ChatGPT
- 티스토리챌린지
- SQL
- 이클립스
- AJAX
- 깃허브
- bootstrap
- spring
- 오블완
- 자바
- Eclipse
- Spring Security
- error
- JavaScript
- Firebase
Archives
- Today
- Total
푸들푸들
1105 [Sakila] 파일 업로드 본문
application properties
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=100MB
파일 하나에 최대 용량 10MB
여러개 최대 용량 100MB
addActor 배우 추가
ActorMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.sakila.mapper.ActorMapper">
<insert id="insertActor" parameterType="com.example.sakila.vo.Actor">
<selectKey resultType="int" keyProperty="actorId" order="AFTER">
select LAST_INSERT_ID()
</selectKey>
INSERT INTO actor (
first_name, last_name
) VALUES(
#{firstName}, #{lastName}
)
</insert>
</mapper>
order="AFTER" : 나중에 실행
insert 문 먼저 실행 -> actorId -> selectKey
select LAST_INSERT_ID() : 마지막으로 입력된 id
#{firstName} = getFirstName
'구디아카데미 > JAVA' 카테고리의 다른 글
1106 [Spring] Decoupling 디커플링 (1) | 2024.11.06 |
---|---|
와이어프레임 - Figma (0) | 2024.11.06 |
1105 [Sakila] Service 추가하기 (0) | 2024.11.05 |
제목 CSS (1) | 2024.11.04 |
1104 동적 Update문 (0) | 2024.11.04 |