- Posts: 2
- Thank you received: 0
×
Modelio 4.0.0 released (07 Nov 2019)
Modelio 4.0.0 has been released ( www.modelio.org/forum/4-announcements/45...-4-0-0-released.html )
The type "Date" was not found: How to resolve this issue?
5 years 9 months ago - 5 years 9 months ago #4258 by jxc328400
I am a java developer but new to Modelio.
I installed Modelio 3.5 on Windows 7 with modules "Java Designer", "Modeler Modules", "Persistent Profile", etc.
I am primarily interested in the "RoundTrip" code generation mode, as I am attaching a screenshot here.
My case is, if I create a java class diagram, and do a code generation, I get ABC.java.
Then I manually insert an attribute and a method in this java file, say,
public testMethod(String tableName, String columnName) {
}
public Date thisDate = null;
and click "Update Model from source if necessary", I want to see the model to show this method and attribute (that is "RoundTrip", right?), but Modelio does not understand the the java type "Date" and "String", for example, I got this warning:
The type "Date" was not found.
A "JavaTypeExpr" tagged value was generated for this type.
and the class model displays: thisDate: <no type>
I read some posts online and I was told I need to do some model-type and java-type mapping in the "javaCustomizationFile.xml". Here is my addins:
<ModelType name="date">
<JavaType name="Date">
<import name="java.util.Date"/>
<wrapper name="Date"/>
</JavaType>
</ModelType>
<ModelType name="string">
<JavaType name="String">
<import name="java.lang.String"/>
<wrapper name="String"/>
</JavaType>
</ModelType>
I found 3 javaCustomizationFile.xml in my machine, I am not sure which one is effective, so I added the above block to all of them, and restart the modelio. However, I am still having the same problem. The above xml-file block seems not effective.
Did I miss anything? Please help.
I installed Modelio 3.5 on Windows 7 with modules "Java Designer", "Modeler Modules", "Persistent Profile", etc.
I am primarily interested in the "RoundTrip" code generation mode, as I am attaching a screenshot here.
My case is, if I create a java class diagram, and do a code generation, I get ABC.java.
Then I manually insert an attribute and a method in this java file, say,
public testMethod(String tableName, String columnName) {
}
public Date thisDate = null;
and click "Update Model from source if necessary", I want to see the model to show this method and attribute (that is "RoundTrip", right?), but Modelio does not understand the the java type "Date" and "String", for example, I got this warning:
The type "Date" was not found.
A "JavaTypeExpr" tagged value was generated for this type.
and the class model displays: thisDate: <no type>
I read some posts online and I was told I need to do some model-type and java-type mapping in the "javaCustomizationFile.xml". Here is my addins:
<ModelType name="date">
<JavaType name="Date">
<import name="java.util.Date"/>
<wrapper name="Date"/>
</JavaType>
</ModelType>
<ModelType name="string">
<JavaType name="String">
<import name="java.lang.String"/>
<wrapper name="String"/>
</JavaType>
</ModelType>
I found 3 javaCustomizationFile.xml in my machine, I am not sure which one is effective, so I added the above block to all of them, and restart the modelio. However, I am still having the same problem. The above xml-file block seems not effective.
Did I miss anything? Please help.
Last Edit: 5 years 9 months ago by jxc328400. Reason: add an image
Please Log in or Create an account to join the conversation.
5 years 9 months ago #4261 by ebr
The following user(s) said Thank You: jxc328400
Please Log in or Create an account to join the conversation.
5 years 6 months ago #4358 by jxc328400
Thank you ebr for my late reply...
I was using Modelio 3.5, I can not follow your steps because I do not have "Java Designer by Modeliosoft". I guess it requires a paid license. Of course I believe I have the right JDK and rt.jar, etc, configured, but I always have the problem for "Round Trip".
However recently I installed Modelio 3.6. I exported by project from Modelio 3.5 and import it to the new version.and this problem seems gone! For example, in the modeled class ABC.java if I have an attribute java.io.Serializable mySer, I generate the code and do some code modification via eclipse, then I tried "Update model from sources if neccessary", I got no errors and no warnings!
Thank you for your detailed explanation anyway,
best wishes
I was using Modelio 3.5, I can not follow your steps because I do not have "Java Designer by Modeliosoft". I guess it requires a paid license. Of course I believe I have the right JDK and rt.jar, etc, configured, but I always have the problem for "Round Trip".
However recently I installed Modelio 3.6. I exported by project from Modelio 3.5 and import it to the new version.and this problem seems gone! For example, in the modeled class ABC.java if I have an attribute java.io.Serializable mySer, I generate the code and do some code modification via eclipse, then I tried "Update model from sources if neccessary", I got no errors and no warnings!
Thank you for your detailed explanation anyway,
best wishes
Please Log in or Create an account to join the conversation.
Time to create page: 0.514 seconds