Details

      Description

      Core models are not accessible in Dynamic Query of Plugins SDK

      in Dynamic Query of Plugins SDK, use following code in knowledge base portlet:

      DynamicQuery query = DynamicQueryFactoryUtil.forClass(Subscription.class, "subscription")
      .add(PropertyFactoryUtil.forName("subscription.companyId").eq(companyId))
      .add(PropertyFactoryUtil.forName("subscription.userId").eq(userId));

      It throws errors:

      19:43:29,500 ERROR [jsp:165] java.lang.NullPointerException
      at org.hibernate.criterion.DetachedCriteria.forClass(DetachedCriteria.java:92)
      at com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl.forClass(DynamicQueryFactoryImpl.java:57)
      at com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil.forClass(DynamicQueryFactoryUtil.java:43)
      at com.liferay.knowledgebase.util.KBSearchUtil.getSubscribedArticlesCount(KBSearchUtil.java:12)

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                6 years, 26 weeks, 3 days ago

                Subcomponents