yasuflatland-lf / damascus

⚔️ CRUD boilerplate generator for Liferay DXP
https://yasuflatland-lf.github.io/damascus-doc/
GNU Lesser General Public License v3.0
50 stars 35 forks source link

Impossible to validate two columns with the same relation entity #97

Open icarrara opened 4 years ago

icarrara commented 4 years ago

Using damascus.build.number=V1.1.5TS20191216114343 - Steps to reproduce:

1) In a entity create two columns of type com.liferay.damascus.cli.json.fields.Long:

{ "type": "com.liferay.damascus.cli.json.fields.Long", "name": "arrivalday", "title": "Arrival Day", "showFieldInView": "false", "required": "true", "validation": { "className": "DayName", "fieldName": "daynameId", "orderByField": "description" } }, { "type": "com.liferay.damascus.cli.json.fields.Long", "name": "departureday", "title": "Departure Day", "showFieldInView": "false", "required": "true", "validation": { "className": "DayName", "fieldName": "daynameId", "orderByField": "description" } }

2) Validate the two columns to the same associated model:

{ "model": "DayName", "title": "Day Name", "web": "true", "asset": { "assetTitleFieldName": "DayNameTitleName", "assetSummaryFieldName": "DayNameSummaryName", "categories": "false", "discussion": "false", "ratings": "false", "tags": "false", "relatedAssets": "true", "fullContentFieldName": "DayNameFullContent", "workflow": "true", "generateActivity": "true", "trash": "true", "advancedSearch": "true", "exportExcel": "true" }, "fieldsName": "DayNames", "fields": [{ "type": "com.liferay.damascus.cli.json.fields.Long", "primary": true, "name": "daynameId", "title": "Day Name Id", "showFieldInView": "false", "required": "true" }, { "type": "com.liferay.damascus.cli.json.fields.Varchar", "name": "description", "title": "Description", "length": "255", "showFieldInView": "true", "required": "true" }, { "type": "com.liferay.damascus.cli.json.fields.Integer", "name": "daynumber", "title": "Numero Giorno", "showFieldInView": "true", "required": "true" } ], "customValue": { "your_own_id": "your_custom_value_for_template_here" } }

3) Do a "damascus create" and then "blade deploy".

4) The Java code is in error because the duplicate "DayName" name causes issues in the -web module.