xml内のSQL文がうまく実行できない

実現したいこと

前提

掲示板アプリを作っています。
投稿する機能を実装中に以下のエラーメッセージが発生しました。
イメージ説明

発生している問題・エラーメッセージ

### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: column "details" does not exist ヒント: There is a column named "details" in table "bbs_app", but it cannot be referenced from this part of the query. 位置: 65 ### The error may exist in com/example/BBS/mapper/BbsMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: insert into bbs_app (name, details) values (?,name(?, details)) ### Cause: org.postgresql.util.PSQLException: ERROR: column "details" does not exist ヒント: There is a column named "details" in table "bbs_app", but it cannot be referenced from this part of the query. 位置: 65 ; bad SQL grammar []] with root cause org.postgresql.util.PSQLException: ERROR: column "details" does not exist ヒント: There is a column named "details" in table "bbs_app", but it cannot be referenced from this part of the query. 位置: 65

該当のソースコード

xml

1<?xml version="1.0" encoding="UTF-8"?>2<!DOCTYPE mapper3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">5<mapper namespace="com.example.BBS.mapper.BbsMapper">6 7 <select id="add" resultType="com.example.BBS.entity.Entity">8 insert into bbs_app (name, details) 9 values (#{name},name(#{details}, details)) //ここがわかりません 10 </select>11</mapper>

html

1<h1>掲示板へようこそ!</h1>2<table>3 <form method="post" action="/" th:action="@{/add}">4 <tr>5 <td><label for="name">名前</label></td>6 <td><input type="text" name="name" id="name"/></td>7 </tr>8 <tr>9 <td><label for="details">投稿内容</label></td>10 <td><input type="text" name="details" id="details"/></td>11 </tr>12 <tr>13 <td><input type="submit"/></td>14 </tr>15 </form>16</table>17<br/>18<table>

試したこと

SQL文の見直し

補足情報(FW/ツールのバージョンなど)

postgresql
springframework.boot' version '3.1.1

コメントを投稿

0 コメント