Beginner |
|
Joined: Mon Jul 09, 2007 2:21 pm Posts: 24
|
I am trying the hibernate code generation using the UI (not through ant task) and clicked on hibernate code generation from eclipse menu and checked "Use Custom Templates" option. then i specified the Template Directory as "\MyProject\config" where i have stored all ftl templates (i have modified some of them for my requirements)
After i run the code generation none of the changes i made to the template are there in the generated code.
for example in pojo.ftl, i added copyright information as follows... But in the generated code i dont see this data...
Do i have to include the directory containing the templates in the classpath or something.
Please help.
/**
*
* Copyright (c) 2007, XXX
* All Rights Reserved.
*
*/
${pojo.getPackageDeclaration()}
// Generated by Hibernate Tools ${version}
<#assign classbody>
<#include "PojoTypeDeclaration.ftl"/> {
<#if !pojo.isInterface()>
<#include "PojoFields.ftl"/>
<#include "PojoConstructors.ftl"/>
<#include "PojoPropertyAccessors.ftl"/>
<#include "PojoToString.ftl"/>
<#include "PojoEqualsHashcode.ftl"/>
<#else>
<#include "PojoInterfacePropertyAccessors.ftl"/>
</#if>
<#include "PojoExtraClassCode.ftl"/>
}
</#assign>
${pojo.generateImports()}
${classbody}
|
|