【发布时间】:2022-10-04 20:48:52
【问题描述】:
我已经使用映射表属性在 Employee 和 Department 表之间建立了多对多关系,它是按名称 Employee_department 生成的第三个表,在 Employee_department 表中,为什么 liferay 会按名称 CompanyId 生成一个额外的列,它会导致 persistenceImpl 类中的错误。
<service-builder package-path="com_m2" auto-namespace-tables="false">
<namespace>emp</namespace>
<entity name="Employee" local-service="true" remote-service="false" table="Employee" uuid="true">
<column name="eid" type="long" primary="true"></column>
<column name="name" type="String"></column>
<column name="address" type="String"></column>
<column name="deptid" type="Collection" entity="Department" mapping-table="Employee_department"/>
</entity>
<entity name="Department" local-service="true" remote-service="false" table="Department" uuid="true">
<column name="deptid" type="long" primary="true"></column>
<column name="department" type="String"></column>
<column name="eid" type="Collection" entity="Employee" mapping-table="Employee_department"/>
</entity>
</service-builder>
-------------------------------------------------------------------------------
create table Employee_department (
CompanyId LONG not null,
deptid LONG not null,
eid LONG not null,
primary key (deptid, eid)
);
【问题讨论】:
标签: liferay liferay-7 liferay-dxp liferay-7.1