Improve SelectBuilder to require less casting
Using the SelectBuilder often requires casting because type information is lost in the API.
One example: https://github.com/spring-projects/spring-data-jdbc/blob/79923b66dc67f49a294a68eeab82a76b5dfaddc1/spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query/JdbcCountQueryCreator.java#L53
We should try to improve the API to require less casting.
Hi @schauder, I want to work on this issue. I made a quick review for the issue. I think related extends should be added in SelectBuilder interface and then related implementations should be added to DefaultSelectBuilder class. Then all casting would be unnecessary. If this issue has any other aspect except above, may you state it, please ? Regards,
There are two things I'm currently aware of that we need to look out for.
- Backward compatibility. It would be nice if we can do the change in a backward compatible way, i.e. usage of the code don't need to change. If we can't maintain backward compatibility we can only introduce the change with 3.x which wouldn't be to bad either.
- It might be that methods that are only intended to be called once, after this change might get called multiple times. If this is the case we must make sure we have a consistent way to handle this. Just using the last call is probably fine.