-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
enhancementImprove a feature or add a new featureImprove a feature or add a new feature
Description
Would be really nice if it would be possible to use @Update, @Insert and also to map the returned object, using PostgreSQL's RETURNING in the statement like:
@Update("UPDATE users " +
"SET name = #{name} " +
"WHERE email = #{email} " +
"RETURNING " +
"id, " +
"name, " +
"email, " +
"username;”)
User updateUser(@Param("email") String email, @Param(“name”) String name);
Currently this is not working. I get the following error:
org.apache.ibatis.binding.BindingException: Mapper method 'com.example.repository.UserDAO.updateUser’ has an unsupported return type: class com.example.model.User
at org.apache.ibatis.binding.MapperMethod.rowCountResult(MapperMethod.java:110)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
...
I have also tried to map the result like:
@Results({
@Result(property = "id", column = "id"),
@Result(property = "name", column = "name"),
@Result(property = "email", column = "email"),
@Result(property = "username", column = "username")
})
but I get the same error.
Note: I am using the following dependency: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:jar:1.3.2
aivinog1 and honza-zidek
Metadata
Metadata
Assignees
Labels
enhancementImprove a feature or add a new featureImprove a feature or add a new feature