Skip to content

Commit 1eb67d4

Browse files
authored
Merge pull request #29 from vanioinformatika/br_readall_fix
readAll method reads records ordered by PK
2 parents e42c1ba + 4e7539d commit 1eb67d4

File tree

1 file changed

+1
-1
lines changed
  • easydao-maven-plugin/src/main/resources/hu/vanio/easydao/templates

1 file changed

+1
-1
lines changed

easydao-maven-plugin/src/main/resources/hu/vanio/easydao/templates/dao.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public class ${t.javaName}${e.daoSuffix}Impl implements ${t.javaName}${e.daoSuff
8181

8282
@Override
8383
public List<${t.javaName}> readAll(<#if t.hasBlobField || t.hasClobField>boolean readLobFields</#if>) {
84-
String query = "select " + SELECTED_FIELDS + " from ${t.dbName}";
84+
String query = "select " + SELECTED_FIELDS + " from ${t.dbName}<#if t.hasPkField && !t.compositePk> order by ${t.pkField.dbName}</#if>";
8585
List<${t.javaName}> retVal = this.jdbcTemplate.query(query, new ${t.javaName}RowMapper(<#if t.hasBlobField || t.hasClobField>readLobFields</#if>));
8686
return retVal;
8787
}

0 commit comments

Comments
 (0)