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

ServiceBuilder : support multiple relations from one entity to another entity


    • Liferay Contributor's Agreement:


      Currently, the "name" attribute of the "column" tag in the service.xml file is not used for anything when defining a "one-to-many" relation nor for a "many-to-many" relation.
      This means that it is currently impossible to define multiple relations between any to entities.

      I think the "name" attribute should be used, and that this should be used to give the relation a name, and therefore it should control the method names being generated in the persistence class.

      I have made a patch which implements this. This patch also contains the changes for the LEP-3957 (which is a suggestion to fix the relation generation code so that it is possible to specify which column is part of the relation, so that not only the primary key of the entity can be part of the relation).

      I would want to do some more testing on this patch. Specifically, I want to run service builder on the trunk with the patch applied, and check that no code is changed in the generated code. I suspect that I must edit some services.xml files, since the value for the "name" attribute seems to be a bit random in some files.
      However, I am not able to test this easily now, because it seems like changes has been submitted to some service builder template files, without the regenerating the java code and checking the java code into Subversion. At least I am seeing a lot of "diffs" when running servicebuilder which is not related to my changes to the template file of servicebuilder.

      Anyway, I want to suggest that this functionality is added, and I appreciate comments, and will do more testing when Subversion contains java code in sync with the service builder template files.




            support-lep@liferay.com SE Support
            alf.hogemark Alf Høgemark (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            7 Vote for this issue
            7 Start watching this issue


              Days since last comment:
              10 years, 48 weeks ago


                Version Package