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

ServiceBuilder generates wrong SQL for add, clear and removeEntity classes in persistenceImpl, if using db-name and mapping-table

    Details

    • Fix Priority:
      4

      Description

      This relates to LPS-3472

      Given service.xml as this
      <entity name="City" [...]>
      <column name="cityId" type="long" primary="true" db-name="CITY_ID" />
      <column name="regionId" type="Collection" entity="Region" db-name="REGION_ID" mapping-table="MAPPING_TABLE" />
      </entity>
      <entity name="Region" [...]>
      <column name="regionId" type="long" primary="true" db-name="REGION_ID" />
      <column name="cityId" type="Collection" entity="City" db-name="CITY_ID" mapping-table="MAPPING_TABLE"/>
      </entity>

      Service builder generates RemoveRegion class that has following sql:
      DELETE FROM MAPPING_TABLE WHERE cityId = ? AND regionId = ?

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Days since last comment:
                6 years, 24 weeks, 5 days ago

                Packages

                Version Package