Details

      Description

      I want to have Type-Safe queries only (to write custom SQL is not acceptable).
      This is my entity in service.xml

      <entity>
              <column db-name="newsId" name="newsId" primary="true" type="long"/>
              <column name="companyId" type="long"/>
              <column db-name="date_from" name="dateFrom" type="Date"/>
              <column db-name="date_to" name="dateTo" type="Date"/>
      
              <finder name="DateFromDateTo" return-type="Collection">
                  <finder-column name="dateFrom" comparator="&gt;="/>
                  <finder-column name="dateTo" comparator="&lt;="/>
              </finder>
          </entity>
      

      In Portlet module for the generated finder method I want to use custom OrderByComparator but its not possible here to have Type-Safe (without Strings "news", "categoryId")

      OrderByComparator<News> orderByComparator = OrderByComparatorFactoryUtil.create("news", "categoryId");
              List<News> newsList = NewsUtil.findByDateFromDateTo(now, now, QueryUtil.ALL_POS, QueryUtil.ALL_POS, orderByComparator, false);
      

      I see that there is constants generated in "service-builder-service" project module

      public class NewsModelImpl extends BaseModelImpl<News> implements NewsModel {
      	public static final String TABLE_NAME = "news";
      	public static final Object[][] TABLE_COLUMNS = ...
      

      The problem is that portlet module have dependency only to "service-builder-api"
      compileOnly project(":modules:service-builder:service-builder-api")

      Adding dependency to "service-builder-service" for the generated constants not looks clean enough for me.. Maybe it's better to move the generated constants in "service-builder-api" module ?

        Attachments

          Activity

            People

            • Assignee:
              support-lep@liferay.com SE Support
              Reporter:
              sytolk Stanimir
              Recent user:
              Lester Pi
              Participants of an Issue:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package