Hello,
I was finding that the values I entered for field length were not being honored when the tables were created. For example, if I had
1 <field>
2 <name>courseName</name>
3 <title>Course Name</title>
4 <type>
5 <varchar>
6 <length>30</length>
7 <filter>true</filter>
8 <order>true</order>
9 </varchar>
10 </type>
11 <showFieldInView>true</showFieldInView>
12 <required>true</required>
13 </field>
The database column courseName was created with the Liferay default varchar(75) length, not varchar(30).
Debugging I found that portlet-model-hints.xml was created with the correct max-length when XMLPortletFactory ran, but gets overwritten and all hints lost when 'ant build-service' runs.
With further debugging I discovered this only happens when the Application classDef name doesn't match the fileDef name. Unless I misunderstand, it seems that having fileDef and classDef names that don't match (different case, for example) should be legal.
I believe there is a bug in Portlet_portlet-model-hints_xml.vm. The model name in portlet-model-hints should be the classname, so I think
1<model name="${packageBase}.${commonData.getClient().toLowerCase()}.${commonData.getProjectName().toLowerCase()}.model.${table.getFileDef().getName()}">
should be
1<model name="${packageBase}.${commonData.getClient().toLowerCase()}.${commonData.getProjectName().toLowerCase()}.model.${table.getClassDef().getName()}">
That is, change ${table.get
FileDef().getName()} to ${table.get
ClassDef().getName()}
When I made this change to the velocity template it seemed to fix the problem. The hints were retained and the tables had the field lengths I expected.