Foren
Liferay Service Builder - Column of type Collection (List<String>)
Julian Perez, geändert vor 6 Jahren.
Liferay Service Builder - Column of type Collection (List<String>)
New Member Beitrag: 1 Beitrittsdatum: 25.07.17 Neueste Beiträge
I am newbie to Liferay. I would like to build with Service Builder the following column for the entity Traveller:
<entity name="Traveller" local-service="true" remote-service="true">
<column name="citiesList" type="Collection"></column>
</entity>
When I run the service Builder, in the class TravellerModel.java the corresponding get/set methods are not generated.
I have tried the following solution without success:
<column name="citiesList" type="Collection" entity="java.lang.String"></column>
Can someone tell me how I can define a list of Strings (List<String>) in Liferay Service Builder?
Thanks in advance.
<entity name="Traveller" local-service="true" remote-service="true">
<column name="citiesList" type="Collection"></column>
</entity>
When I run the service Builder, in the class TravellerModel.java the corresponding get/set methods are not generated.
I have tried the following solution without success:
<column name="citiesList" type="Collection" entity="java.lang.String"></column>
Can someone tell me how I can define a list of Strings (List<String>) in Liferay Service Builder?
Thanks in advance.
David H Nebinger, geändert vor 6 Jahren.
RE: Liferay Service Builder - Column of type Collection (List<String>)
Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste BeiträgeJulian Perez:
Can someone tell me how I can define a list of Strings (List<String>) in Liferay Service Builder?
Liferay cannot persist this. You need to marshal it to/from a String and persist it as a single value.
You can automate this of course by adding the List support and marshaling in the XxxImpl class.
Come meet me at Devcon 2017 or 2017 LSNA!