spring-projects / spring-projects/spring-data-relational
How to skip mybatis method lookup when extends MybatisMapper
Open
Nobody has claimed this yet.
type: enhancement
- Dominant language
- Java
- Stars
- 827
- Forks
- 394
- PR merge metrics
- No merged PRs in 30d
Description
Mybatis mapper:
@Mapper
public interface SysUserMapper {
@Transactional(readOnly = true)
List<SysUserFullNamePj> selectFullName();
@Transactional(readOnly = true)
List<SysUser> selectAll();
}
Spring Data JDBC:
@Repository
public interface SysUserRepo extends PagingAndSortingRepository<SysUser, Long>, SysUserMapper {
Optional<SysUser> findFirstByUsernameEqualsIgnoreCase(String username);
}
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property 'selectAll' found for type 'SysUser'
Example:
@EnableJdbcRepositories(excludeNamedQueriesStartWith = "select")
@EnableJdbcRepositories(mybatisMethodPrefix = "select")
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the @EnableJdbcRepositories examples and the PropertyReferenceException as entry points; inspect how methods inherited from SysUserMapper are considered during repository query derivation. Done means a repository can extend both interfaces without treating selectAll and selectFullName as derived Spring Data JDBC queries, with the supplied configuration behavior covered by a test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100