Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-46392

GroupNameComparator has column name that doesn't match with Database column name

    Details

    • Fix Priority:
      2

      Description

      when using the GroupNameComparator for custom SQL to add a ORDER BY, a SQL error is thrown

      21:13:07,012 ERROR [RuntimePageImpl-2][JDBCExceptionReporter:82] Unknown column 'groupName' in 'order clause'
      Apr 29, 2014 9:13:07 PM org.apache.catalina.core.ApplicationDispatcher invoke
      SEVERE: Servlet.service() for servlet jsp threw exception
      com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'groupName' in 'order clause'
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
      at com.mysql.jdbc.Util.getInstance(Util.java:386)
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
      at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322)

      this is discovered during the fix for LPS-46246, when trying to use GroupLocalServiceUtil.getLayoutsGroups(long companyId, long parentGroupId, boolean site, int start, int end, OrderByComparator obc), and passing the GroupNameComparator object as a parameter.

        Attachments

          Activity

            People

            Assignee:
            xinsui.zhao Xinsui Zhao (Inactive)
            Reporter:
            xinsui.zhao Xinsui Zhao (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              8 years, 11 weeks, 6 days ago

                Packages

                Version Package
                7.0.0 M3