Changeset 2812
- Timestamp:
- Oct 27, 2006, 12:58:29 PM (17 years ago)
- Location:
- trunk/src/core/net/sf/basedb/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/net/sf/basedb/core/ItemContext.java
r2754 r2812 1054 1054 if (sortProperties != null) 1055 1055 { 1056 boolean selectSortProperties = 1057 query.isDistinct() && HibernateUtil.getDbEngine().selectOrderByColumnsIfDistinct(); 1058 int sortIndex = 0; 1056 1059 String[] sp = sortProperties.split(","); 1057 1060 for (String sortProperty : sp) … … 1061 1064 { 1062 1065 query.order(SortDirection.ASC == getSortDirection() ? Orders.asc(sortby) : Orders.desc(sortby)); 1066 if (selectionList == null || !selectionList.contains(sortProperty)) 1067 { 1068 // We must add the sort property to the selection list 1069 query.select(Selects.expression(sortby, "sorted" + sortIndex)); 1070 } 1063 1071 } 1072 sortIndex++; 1064 1073 } 1065 1074 } -
trunk/src/core/net/sf/basedb/core/dbengine/AbstractDbEngine.java
r2804 r2812 93 93 } 94 94 /** 95 Returns FALSE. 96 */ 97 public boolean selectOrderByColumnsIfDistinct() 98 { 99 return false; 100 } 101 102 /** 95 103 Return <code>LN(<value>)</code>. 96 104 */ -
trunk/src/core/net/sf/basedb/core/dbengine/DbEngine.java
r2804 r2812 179 179 180 180 /** 181 If the database requires that columns appearing in the 182 ORDER BY part of the query must also be part of the SELECT 183 list when using the DISTINCT keyword. 184 @return TRUE if order by columns must be selected, FALSE otherwise 185 */ 186 public boolean selectOrderByColumnsIfDistinct(); 187 188 /** 181 189 If we need to check for invalid arguments to numerical 182 190 functions to avoid exceptions from the database. Postgres, -
trunk/src/core/net/sf/basedb/core/dbengine/PostgresDbEngine.java
r2804 r2812 186 186 return true; 187 187 } 188 /** 189 Returns TRUE. 190 */ 191 public boolean selectOrderByColumnsIfDistinct() 192 { 193 return true; 194 } 188 195 // ------------------------------------------- 189 196
Note: See TracChangeset
for help on using the changeset viewer.