application.yml
server:
port: 8080
spring:
datasource:
url: jdbc:mariadb://127.0.0.1:3306/security
username: root
password: 1234
driver-class-name: org.mariadb.jdbc.Driver
jpa:
hibernate:
ddl-auto: create #create update none
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
show-sql: true
# Mapper Xml Location
mybatis:
mapper-locations:
- classpath:mapper/**/*.xml
mybatis xml
mybatis xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTO Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.boot.setting.web.front.mapper.BoardMapper">
<!-- 게시판 목록 조회 -->
<select id="getBoardList" resultType="map">
SELECT * FROM BOARD
</select>
<!-- 게시판 상세 조회 -->
<select id="getBoard" resultType="map">
SELECT * FROM BOARD WHERE bno = #{bno}
</select>
<!-- 게시판 글 작성 -->
<insert id="insertBoard">
INSERT INTO BOARD (id, title, writer) values(#{id}, #{title}, #{writer})
</insert>
<!-- 게시판 글 작성 -->
<insert id="updateBoard">
UPDATE SET BOARD (id, title, writer, updatedate) values(#{id}, #{title}, #{writer}, now())
</insert>
<!-- 게시판 글 삭제 -->
<delete id="deleBoard">
DELETE FROM BOARD WHERE bno = #{bno}
</delete>
</mapper>