Uploaded image for project: 'PUBLIC - Liferay Documentation'
  1. PUBLIC - Liferay Documentation
  2. LRDOCS-2956

Custom SQL Documentation Incorrect

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 7.0.x
    • Component/s: Core Infrastructure
    • Labels:
      None

      Description

      While going through the Custom SQL documentation for a POC, we identified a few problems. It seems that the documentation is based on LR 6.2 and has not been updated to reflect 7.0 changes.

      https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/custom-sql

      1) Location of the default.xml file is incorrect. The OSGi container cannot find the file in the documented location src/custom-sql/ of the module directory. Instead it needs to be in the module's src/main/resources/META-INF/custom-sql

      2) The call to the CustomSQLUtil.get() method in the example needs to updated to reflect the new overloaded version of the method with different parameters (original method not available anymore).

      Replace:

              String sql = CustomSQLUtil.get(
                  FIND_BY_ENTRYNAME_ENTRYMESSAGE_GUESTBOOKNAME);
      

      With:

              String sql = CustomSQLUtil.get(getClass(),
                  FIND_BY_ENTRYNAME_ENTRYMESSAGE_GUESTBOOKNAME);
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                7.0.x