Uploaded image for project: 'ZZZ: PUBLIC - Old Liferay Portal (Use Liferay Portal Standard Edition)'
  1. ZZZ: PUBLIC - Old Liferay Portal (Use Liferay Portal Standard Edition)
  2. LEP-6600

Add support for Correlated subqueries to Dynamic Query API

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 5.1.0
    • None
    • None

    Description

      For example (this is a little contrived, but demonstrates none the less):

      DynamicQuery dq0 = DynamicQueryFactoryUtil.forClass(User.class, "user")
      .setProjection(ProjectionFactoryUtil.property("contactId"))
      .add(PropertyFactoryUtil.forName("user.companyId").eqProperty("contact.companyId"))
      .add(PropertyFactoryUtil.forName("user.screenName").like("%dlc%"));

      DynamicQuery dq1 = DynamicQueryFactoryUtil.forClass(Contact.class, "contact")
      .add(PropertyFactoryUtil.forName("contact.contactId").in(dq0))
      .addOrder(OrderFactoryUtil.desc("contact.modifiedDate"));

      List results = UserLocalServiceUtil.dynamicQuery(dq1);

      Attachments

        Activity

          People

            raymond.auge Raymond Auge
            raymond.auge Raymond Auge
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Packages

                Version Package
                5.1.0