-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 5.1 EE SP5 (5.1.8), 5.2 EE SP3 (5.2.7)
-
Fix Version/s: 5.1 EE SP6 (5.1.9), 5.2 EE SP4 (5.2.8)
-
Component/s: Dev Tools > Service Builder
-
Labels:None
-
Environment:All
ServiceBuilder generates wrong SQL for "primary key" in mapping-tables if "db-name" is used. For example, given the following service.xml:
<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>
The resulting SQL is:
create table MAPPING_TABLE (
REGION_ID LONG not null,
CITY_ID LONG not null,
primary key (regionId, cityId)
);
The correct SQL is:
create table MAPPING_TABLE (
REGION_ID LONG not null,
CITY_ID LONG not null,
primary key (REGION_ID, CITY_ID)
);
- is related to
-
LPS-3472 ServiceBuilder generates wrong SQL for "primary key" in mapping-tables, if using db-name
- Closed