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

ServiceBuilder throws when generating mapping tables for entities that are not within the same service.xml

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: 5.1.2, 5.2.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Branch Version/s:
      5.2.x
    • Liferay Contributor's Agreement:
      Accept

      Description

      When trying to generate a mapping table for MyCustomEntity and one of the entities in core like Organization, ServiceBuilder throws the following exception:

      assignment: tempEntity=serviceBuilder.getEntity(column.getEJBName()) [on line 266, column 33 in com/liferay/portal/tools/servicebuilder/dependencies/persistence_impl.ftl]

      This is because _ejbList does not contain any entries when ServiceBuilder is processing persistence_impl.ftl. _entityPool does contain a reference to the mapping table so it can be used instead.

      Assuming that you have an entity called "Passcodes" and you want to create a mapping table with the Organization_ table, the correct syntax is as follows:

      <!-- Relationships -->

      <column name="orgs" type="Collection" entity="Organization" mapping-table="Passcodes_Orgs" />

      <!-- References -->

      <reference package-path="com.liferay.portal" entity="Organization" />

        Attachments

          Activity

            People

            Assignee:
            edward.shin Edward Shin (Inactive)
            Reporter:
            edward.shin Edward Shin (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              11 years, 39 weeks, 5 days ago

                Packages

                Version Package