Open full view…

Can I alter the default naming convention for Entities?

Thu, 06 Apr 2017 12:58:07 GMT

I am using the persistence-springdatajpa templates to create Entities. The process works fine against the mySql database that I am using, but the output entities all have the word "Entity" appened to them. For example:,, etc. Is there a way to change the naming convention to remove that word from the name?

Telosys Team
Wed, 12 Apr 2017 15:58:00 GMT

Yes, you can change it, you just have to edit : - the "templates.cgf" file to change the generated file name : eg "${BEANNAME}" can be changed to "${BEANNAME}.java" - the template used to generate the file "jpa_bean_with_links.vm" to change the class name : eg remove the line #set ( $env.entityClassNameSuffix = "Entity" ) If you are in the Eclipse plugin just click on the "templates.cfg" icon and on the "edit" icon for the ".vm" file