I work on an application that has been converted from pure JDBC to Spring template with row mapper. The issue that I have is that the column in database doesn’t match the property names which prevent me from using BeanPropertyRowMapper easily.
I saw some posts about using aliases in queries. This would work but it makes it impossible to do a SELECT *
Isn’t there any annotation that can be used with BeanPropertyRowMapper as @Column from JPA?
This is actually an approach suggested in JavaDocs:
From:
BeanPropertyRowMapper.Please do not use
SELECT *. This makes you vulnerable to any database schema change, including completely backward compatible ones like adding or rearranging columns.Yes, it is called jpa, hibernate and maybe ibatis. Seriously, either use aliases or implement your own
RowMapper, Spring is not a full-featured orm.