public void testColumnNamesCapitalization() throws Exception {
createFourArtistsAndThreePaintingsDataSet();
String template = "SELECT * FROM ARTIST ORDER BY ARTIST_ID";
SQLTemplate query = new SQLTemplate(Artist.class, template);
query.setColumnNamesCapitalization(CapsStrategy.LOWER);
query.setFetchingDataRows(true);
List<DataRow> rows = context.performQuery(query);
DataRow row1 = rows.get(0);
assertFalse(row1.containsKey("ARTIST_ID"));
assertTrue(row1.containsKey("artist_id"));
DataRow row2 = rows.get(1);
assertFalse(row2.containsKey("ARTIST_ID"));
assertTrue(row2.containsKey("artist_id"));
query.setColumnNamesCapitalization(CapsStrategy.UPPER);
List<DataRow> rowsUpper = context.performQuery(query);
DataRow row3 = rowsUpper.get(0);
assertFalse(row3.containsKey("artist_id"));