<select id="selectMovieListByActorId" parameterType="java.lang.Integer" resultType="team.first.movie_api.domain.Movie">select*from movie_db.movie where id in(select movie_id from movie_with_actor where actor_id = ${id,jdbcType=INTEGER})</select>
我的mapper接口方法是
List<Movie> selectMovieListByActorId(Integer id);
数据库中表的字段都为int4,没有varchar类型
执行报错:
### Error querying database. Cause:org.postgresql.util.PSQLException: 错误: 操作符不存在: character varying = integer
建议:没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换.
位置:107
### The error may exist in file [E:\实用数据库开发\project\movie-api-boot\target\classes\mapper\ActorMapper.xml]
### The error may involve team.first.movie_api.mapper.ActorMapper.selectMovieListByActorId-Inline
### The error occurred while setting parameters
### SQL: select * from movie_db.movie where id in (select movie_id from movie_with_actor where actor_id =1031862)
### Cause:org.postgresql.util.PSQLException: 错误: 操作符不存在: character varying = integer
建议:没有匹配指定名称和参数类型的操作符. 您也许需要增加明确的类型转换.
位置:107
<select id="selectMovieListByActorId" parameterType="java.lang.Integer" resultType="team.first.movie_api.domain.Movie">select*from movie_db.movie where id in(select movie_id from movie_db.movie_with_actor where actor_id = ${id,jdbcType=INTEGER})</select>
【Postgres SQL】报错:操作符不存在: character varying = integer(但是我的数据类型都是Integer)
我使用mybatis操作pgsql数据库,查询语句如下:<select id="selectMovieListByActorId" parameterType="java.lang.Integer" resultType="team.first.movie_api.domain.Movie"> select * from movie_db.movie where id in ( select movie_id from movie_with_actor wher