Affects Version/s: 6.2.0 CE M4
Fix Version/s: 6.2.0 CE M4
Similar Issues:Show 5 results
LPS-26493 Service Builder generates faulty getXXXSize() for one-to-many relations LPS-49769 Service Builder using mapping table gets exception or gens bad code LPS-2908 *LocalServiceUtil static methods have too many complex parameters - replace with Builder Pattern LPS-46451 ClassCastException when redeploying a service builder plugin with a mapping-table association LPS-9680 Create a Service Builder Maven plugin
Service Builder's one to many mapping is useless.
The reasons are very simple:
1) On the one side, we generate sql like this(Use TrashEntry as example):
This is logically the same as :
FROM TrashVersion WHERE (TrashVersion.entryId = ?)
The inner join is useless and inefficient.
The service layer should contain the business logic to eliminate the possibility that we have a "Many side record without the one side counterpart".
2) On the many side, we already generate a finder to the one side, i.e. TrashEntry, that would be the "EntryId" finder in TrashVersion.
Since we inject all persistence automatically into service, developer can always call the many side finder to do the query which is much more efficient at both the sql level and cache level.