Fórum

Liferay Service Builder - Column of type Collection (List<String>)

Julian Perez, modificado 6 Anos atrás.

Liferay Service Builder - Column of type Collection (List<String>)

New Member Mensagem: 1 Data de Entrada: 25/07/17 Postagens Recentes
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.
thumbnail
David H Nebinger, modificado 6 Anos atrás.

RE: Liferay Service Builder - Column of type Collection (List<String>)

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Julian 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!