### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'new_schema.tom_test_product' doesn't exist
配置文件如下
<?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.text.xxx.webapp.bis.business.persistence.TomTestProductMapper">
<cache />
<!-- 查找 -->
<select id="findOneProductById" parameterType="Integer" resultType="TomTestProduct" flushCache="true">
<![CDATA[
SELECT
product_id as productId,
product_name as productName,
product_price as productPrice,
product_status as productStatus,
product_picture as productPicture,
product_desc as productDesc
FROM tom_test_product
where
product_id=#{id}
]]>
</select>
<select id="findTomTestProductByProperty" parameterType="TomTestProduct" resultType="TomTestProduct" flushCache="true">
<![CDATA[
SELECT
product_id as productId,
product_name as productName,
product_price as productPrice,
product_status as productStatus,
product_picture as productPicture,
product_desc as productDesc
FROM tom_test_product
]]>
</select>
<!-- 增加 -->
<insert id="saveTomTestProductInfo" parameterType="TomTestProduct" keyColumn="GENERATED_KEY" useGeneratedKeys="true" keyProperty="productId" flushCache="true">
<![CDATA[
INSERT INTO tom_test_product(
product_name,
product_price,
product_status,
product_picture,
product_desc
)
VALUES
(
#{productName},
#{productPrice},
#{productStatus},
#{productPicture},
#{productDesc}
)
]]>
</insert>
<!-- 修改 -->
<update id="updateTomTestProduct" parameterType="TomTestProduct">
UPDATE tom_test_product
SET
product_id = #{productId},
product_name = #{productName},
product_price = #{productPrice},
product_status = #{productStatus},
product_picture = #{productPicture},
product_desc = #{productDesc}
WHERE product_id = #{productId}
</update>
<!-- 删除 -->
<delete id="deleteTomTestProduct" parameterType="TomTestProduct">
DELETE FROM tom_test_product
WHERE product_id = #{productId}
</delete>
</mapper>
------解决方案--------------------
敢自己读一下错误信息吗。。。。
Table 'new_schema.tom_test_product' doesn't exist
表不存在,看看是不是库名/表名写错了,还是没建好