Changeset 1940


Ignore:
Timestamp:
Jun 24, 2011, 3:41:41 PM (5 years ago)
Author:
robert@…
Message:

Bugfix for querying without criteria

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/groovy/dbnp/query/Search.groovy

    r1917 r1940  
    169169               
    170170                // Generate where clause
    171                 def whereClause = " WHERE ";
     171                def whereClause = "";
    172172                if( fullHQL.where ) {
    173173                        whereClause += " ( " + fullHQL.where.join( " " + searchMode.toString() + " "  ) + " ) "
     
    190190               
    191191                // Combine all parts to generate a full HQL query
    192                 def hqlQuery = selectClause + " " + fullHQL.from + whereClause;
     192                def hqlQuery = selectClause + " " + fullHQL.from + ( whereClause ? " WHERE " + whereClause : "" );
    193193               
    194194                // Find all objects
Note: See TracChangeset for help on using the changeset viewer.