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

Passing empty list to query criterion "in" cause SQL syntax error.

Details

    Description

      This code cause SQL syntax error.

      Collection<Long> userIds = new ArrayList<Long>();

      DynamicQuery userQuery = DynamicQueryFactoryUtil.forClass(User.class).add(PropertyFactoryUtil.forName("companyId").eq(companyId))
      .add(PropertyFactoryUtil.forName("userId").in(userIds.toArray()));

      List<User> users = userLocalService.dynamicQuery(userQuery);

      Attachments

        Activity

          People

            mika.koivisto Mika Koivisto (Inactive)
            lcharlois Laurent CHARLOIS (Inactive)
            Kiyoshi Lee Kiyoshi Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9 years, 33 weeks, 2 days ago

              Packages

                Version Package
                6.1.1 CE GA2