从Modelio UML的.xmi文件在JHipster生成实体时遇WrongTypeException错误
Fixing "ELong isn't supported by JHipster" Error When Importing Modelio XMI
Got it, let's tackle this error you're facing when trying to generate JHipster entities from a Modelio UML .xmi file. The root issue is straightforward: Modelio uses its own custom type ELong for numeric fields, and JHipster's entity importer doesn't recognize this non-standard type. Here are two reliable ways to fix it:
Option 1: Update the Type Directly in Modelio
This is the cleanest approach if you have access to the original Modelio project:
- Open your Modelio project and navigate to the entity with the
ELongproperty. - Edit the property's type and replace
ELongwith Long (JHipster fully supports this standard Java numeric type). If your value range is smaller, you could also useIntegerinstead. - Re-export the UML model as an XMI file, then try importing it into JHipster again.
Option 2: Manually Edit the XMI File
If you don't want to go back to Modelio, you can directly modify the XMI file:
- Open the .xmi file in a text editor (like VS Code, Sublime Text, or Notepad++).
- Use the editor's "Find and Replace" feature to globally swap every instance of
ELongwithLong. Make sure to match the exact case—JHipster is case-sensitive about type names. - Save the modified XMI file and run the JHipster entity import command again.
Quick Check for Other Type Issues
While you're at it, double-check other property types in your Modelio model/XMI file to avoid similar errors:
- Modelio's
EStringmaps to JHipster'sString EIntegermaps toIntegerEDatemaps to eitherLocalDateorLocalDateTime(pick based on whether you need time components)EBooleanmaps toBoolean
内容的提问来源于stack exchange,提问作者Eduardo Toural
相关产品推荐
相关产品推荐

