Skip to content

Commit

Permalink
Enhance storage layer unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoellnitz committed Mar 20, 2016
1 parent d6e3150 commit 4841788
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jpa/src/org/tangram/jpa/JpaBeanFactoryImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ public <T extends Content> List<T> listBeansOfExactClass(Class<T> cls, String qu
queryString = queryString==null ? "select x from "+simpleName+" x" : queryString;
// Default is no ordering - not even via IDs
if (orderProperty!=null) {
queryString += " order by "+orderProperty+(ascending ? " asc" : " desc");
String boundName = queryString.substring(7);
int idx = boundName.indexOf(' ');
boundName = boundName.substring(0, idx);
queryString += " order by "+boundName+"."+orderProperty+(ascending ? " asc" : " desc");
} // if
LOG.info("listBeansOfExactClass() looking up instances of {} with condition {}", simpleName, queryString);
Query query = manager.createQuery(queryString, cls);
Expand Down

0 comments on commit 4841788

Please sign in to comment.