I have a Java Batch job which uses plain JDBC to execute lot of queries with lot of joins. I decided to convert the plain JDBC code to Spring JDBC project which uses JDBCTemplate.
Its purely a command line batch program and there is no GUI. There are around 40 tables and 4-5 tables have 300+ columns. I am not sure whether to create Entity classes for those tables or create DTO pojo classes?
I understand that DTO classes are to decouple the entity classes and view. Since I do not have GUI and I am dealing with only DB with lot of handmade queries with joins , is it better to use only entity classes instead of DTO classes ? I'm not using JPA , instead I am using spring JDBC.
So the code looks like
List<Customer> customers = jdbcTemplate.query(
sql,
new BeanPropertyRowMapper(Customer.class));
Here the Customer should be a Entity class or DTO? Please advise.