I saw several posts about using aliases in queries
This is actually the approach suggested in JavaDocs:
To facilitate matching columns and fields that do not have matching names, try using column aliases in the SQL expression, for example, "select fname as first_name from client".
From: BeanPropertyRowMapper .
unable to execute SELECT *
Please do not use SELECT * . This makes you vulnerable to any changes to the database schema, including those fully compatible with feedback, such as adding or reordering columns.
Is there any annotation that can be used with BeanPropertyRowMapper like @Column from JPA?
Yes, it is called jpa , hibernate, and possibly ibatis . Seriously, either using aliases or using your own RowMapper , Spring is not a fully functional orm .
source share