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

Error on com.liferay.portlet.journal.service.persistence.JournalArticleFinder.findByC_G_F_C_A_V_T_D_C_T_S_T_D_R custom SQL query

    Details

      Description

      There's an error in the custom SQL query which search for Journal Article: com.liferay.portlet.journal.service.persistence.JournalArticleFinder.findByC_G_F_C_A_V_T_D_C_T_S_T_D_R.
      By calling this finder method, all the results are returned everytime, like the filter is ignored.
      A possibile solution could be a small change in the SQL query.
      From (I'll show only the head part of the query):

      SELECT
      	JournalArticle.*
      FROM
      	JournalArticle
      LEFT JOIN JournalArticle tempJournalArticle ON
      	(JournalArticle.groupId = tempJournalArticle.groupId) AND
      	(JournalArticle.articleId = tempJournalArticle.articleId) AND
      	(JournalArticle.version < tempJournalArticle.version)
      

      To:

      SELECT
      	JournalArticle.*
      FROM
      	JournalArticle
      LEFT JOIN JournalArticle tempJournalArticle ON
      	(JournalArticle.groupId = tempJournalArticle.groupId) AND
      	(JournalArticle.articleId = tempJournalArticle.articleId) AND
      	(JournalArticle.version <= tempJournalArticle.version)
      

      I just changed the < clause to <=.

        Attachments

          Activity

            People

            Assignee:
            michael.saechang Michael Saechang
            Reporter:
            napo Marco Napolitano
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              7 years, 38 weeks ago

                Packages

                Version Package