Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
HI
I am in the process of upgrading to Hibernate 3.1.3 and I am in the need of converting the existing custom velocity template to freemarker template as hibernate tools now use only freemarker template. I used the convertor provided in Freemarker site to convert my pojo.vm to Pojo.ftl.
But, with freemarker template, I am not able to use the expression - ${pojo.getPackageDeclaration($clazz)} as it says not valid. Hence I am forced to use ${pojo.getPackageDeclaration()} instead. But this will deny me the usage of clazz across my ftl file to fetch fields, scope and many other params.
So , pls let me know how to use the clazz object in freemarker template that will help me to use functions like clazz.getLocalFieldsForFullConstructor(), clazz.generatedName, clazz.getFields(),.
Thanks. A quick response is very much appreciated.
Hibernate version:
3.1.3
Mapping documents:
My Pojo.FTL (Built using Velocity to freemarker converter utility)
${pojo.getPackageDeclaration($clazz)}
// Generated ${date} by Hibernate Tools ${version}
${pojo.generateImports()}
${classbody}
import com.comcast.commsales.util.StringUtils;
import com.comcast.commsales.ui.UIUtils;
<#-- PSK ${classimports}
-->
<#-- PSK I'm not sure why this isn't working properly, I'm hacking this
--><#-- in right now just to get things moving... This will produce a lot of
--><#-- redundant imports, but they will all compile out.
-->
<#foreach import_field in clazz.getFields()>// ${import_field}
<#if import_field.toString().indexOf("commsales.hibernate") == -1> import ${pojo.getTrueTypeName(import_field, class2classmap)};
</#if></#foreach>
<#-- PSK This is for comparing properties later.
--><#assign s_prefix = "S">
<#if clazz.hasMeta("class-description")>/**
${pojo.toJavaDoc(clazz.getMetaAsString("class-description"), 0)} */
<#else>/**
* POJO for ${clazz.generatedName}
* @author hbm2java
*/
</#if>${clazz.modifiers} ${clazz.scope} ${clazz.declarationType} ${clazz.generatedName}<#if pojo.hasExtends(clazz)> extends ${pojo.getExtends(clazz)}</#if><#if pojo.hasImplements(clazz)> implements ${pojo.getImplements(clazz)}</#if> {
// Statics
private static final java.util.Date DEFAULT_DATE = (new java.util.GregorianCalendar( 1753, 0, 1 )).getTime();
private static final java.math.BigDecimal DEFAULT_NUMBER = new java.math.BigDecimal( 0 );
<#if !clazz.isInterface()> // Fields
<#foreach field in clazz.getFields()> <#-- nullable persistent comment not included
--> ${field.getFieldScope()} ${pojo.getTrueTypeName(field, class2classmap)} ${field.fieldName};
</#foreach>
// Constructors
<#if (clazz.getAllFieldsForFullConstructor().size()>0)> /** default constructor */
public ${clazz.generatedName}() {
<#-- PSK We need to initialize these fields to default values for clarify. Numbers should be 0 and dates should be
--><#-- 1/1/1753
--><#foreach field in clazz.getFields()><#-- nullable persistent comment not included
--> <#if pojo.getTrueTypeName(field, class2classmap) == "java.math.BigDecimal"> <#if field.fieldName != "objid" && field.fieldName != "dev" && field.fieldName.indexOf("2") < 0> ${field.fieldName} = DEFAULT_NUMBER;
</#if> </#if> <#if pojo.getTrueTypeName(field, class2classmap) == "java.util.Date"> ${field.fieldName} = DEFAULT_DATE;
</#if></#foreach> }
</#if>
/** full constructor */
/* PSK Commenting out because of unsafe usage. Middlegen will sometimes reorder the
parameters of this constructor. So we shouldn't use it.
public ${clazz.generatedName}(${pojo.fieldsAsParameters(clazz.getAllFieldsForFullConstructor(), clazz, class2classmap)}) {
<#if !clazz.getFieldsForSupersFullConstructor().isEmpty()> super(${pojo.fieldsAsArguments(clazz.getFieldsForSupersFullConstructor(), clazz, class2classmap)});
</#if> <#foreach field in clazz.getLocalFieldsForFullConstructor()> this.${field.fieldName} = ${field.fieldName};
</#foreach> }
*/
<#if (clazz.getAllFieldsForFullConstructor().size()>0) && clazz.needsMinimalConstructor()> /** minimal constructor */
/* PSK commenting this out too
public ${clazz.generatedName}(${pojo.fieldsAsParameters(clazz.getAllFieldsForMinimalConstructor(), clazz, class2classmap)}) {
<#if !clazz.getFieldsForSupersMinimalConstructor().isEmpty()> super(${pojo.fieldsAsArguments(clazz.getFieldsForSupersMinimalConstructor(), clazz, class2classmap)});
</#if> <#foreach field in clazz.getLocalFieldsForMinimalConstructor()> this.${field.fieldName} = ${field.fieldName};
</#foreach> }
*/
</#if>
<#-- Property accessors
--> <#foreach field in clazz.getFields()> <#if property.hasMeta("field-description")> /**
${pojo.toJavaDoc(clazz.getMetaAsString("field-description"), 4)} */
</#if> <#-- getter
--> ${field.getPropertyGetScope()} ${pojo.getTrueTypeName(field, class2classmap)} ${field.getGetterSignature()} {
<#if pojo.getTrueTypeName(field, class2classmap) == "java.util.Date"> if( this.${field.fieldName} == null || DEFAULT_DATE.equals( this.${field.fieldName} ) ) {
return null;
}
</#if> <#if pojo.getTrueTypeName(field, class2classmap) == "java.util.Set"> if( this.${field.fieldName} == null ) {
Set set = new java.util.HashSet();
set${field.getAccessorName()}( set );
}
</#if> return this.${field.fieldName};
}
<#-- PSK This is a helper method for UI's string interaction
--><#assign s_AsString = "AsString()"> <#if pojo.getTrueTypeName(field, class2classmap) == "java.math.BigDecimal"> <#if field.fieldName != "objid"> ${field.getPropertyGetScope()} String get${field.getAccessorName()}${s_AsString} {
if( this.${field.fieldName} == null ) {
return null;
}
<#assign s_toString = ".toString()"> return this.${field.fieldName}${s_toString};
}
</#if> </#if>
<#-- PSK This is a helper method for UI's string interaction
--> <#if pojo.getTrueTypeName(field, class2classmap) == "java.math.BigDecimal"> <#if field.fieldName != "objid">
${field.getPropertyGetScope()} void setRaw${field.getAccessorName()}( String ${field.getFieldName()} ) {
BigDecimal bd;
if( StringUtils.isEmpty( ${field.getFieldName()} ) ) {
bd = null;
} else {
bd = new BigDecimal( ${field.getFieldName()} .trim() );
}
set${field.getAccessorName()}( bd );
}
${field.getPropertySetScope()} void set${field.getAccessorName()}(String ${field.getFieldName()}) {
BigDecimal bd;
if( StringUtils.isEmpty( ${field.getFieldName()} ) ) {
// PSK if the field is nulled out, we need to go back to the default number. Odd behavior(?) per Eric.
bd = DEFAULT_NUMBER;
} else {
bd = new BigDecimal( ${field.getFieldName()} .trim() );
}
set${field.getAccessorName()}( bd );
}
</#if> </#if>
<#-- setter
--> ${field.getPropertySetScope()} void set${field.getAccessorName()}(${pojo.getTrueTypeName(field, class2classmap)} ${field.getFieldName()}) {
<#--PSK Check for a this property prefixed with an 'S'. If this exists, we need
--><#-- to set it to the uppercase value of this property. This is for clarify's
--><#-- case insensitive searching.(and their constraints)
--><#assign s_fieldName = s_prefix + field.fieldName.toUpperCase()> <#--looking for S property: $s_fieldName
--><#foreach check_s_field in clazz.getFields()><#assign check_s_fieldName = check_s_field.fieldName.toUpperCase()> <#--looking for CHECK S property: $check_s_fieldName
--> <#if check_s_fieldName == s_fieldName> <#--found an S property
--> <#-- Note the space before .toUpperCase() is important! It makes it a
--> <#-- literal string. Don't remove it.
--> if( ${field.fieldName} != null ) {
set${check_s_field.getAccessorName()}( ${field.fieldName} .toUpperCase() );
}
</#if></#foreach>
this.${field.fieldName} = ${field.fieldName};
}
</#foreach><#else> <#-- if !interface
--> <#-- Property accessors for interface
--> <#foreach field in clazz.getFields()> <#if property.hasMeta("field-description")> /**
${pojo.toJavaDoc(clazz.getMetaAsString("field-description"), 4)} */
</#if> <#-- getter
-->${field.getPropertyGetScope()} ${pojo.getTrueTypeName(field, class2classmap)} ${field.getGetterSignature()};
<#-- setter
--> ${field.getPropertySetScope()} void set${field.getAccessorName()}(${pojo.getTrueTypeName(field, class2classmap)} ${field.getFieldName()});
</#foreach></#if>
<#if clazz.generatedName != "AdpTblNameMap" && clazz.generatedName != "AdpDbHeader" && clazz.generatedName != "AdpTblOid">
<#-- PSK This is a cheap and easy equals method.
--> public boolean equals( Object obj ) {
if( getObjid() != null ) {
return getObjid().equals( ((${clazz.generatedName})obj).getObjid() );
}
// We can't do a comparison here, lets just return false.
return false;
}
<#-- PSK This is a cheap and easy hashcode method.
--> public int hashCode() {
if( getObjid() != null ) {
return getObjid().intValue();
} else {
/* (new Exception()).printStackTrace( System.out ); */
return 0;
}
}
<#-- PSK This is for hibernate queries.
--> /**
* This is needed for hibernate queries. Since hibernate doesn't accept a
* BigDecimal in its queries, we need to convert it to the next best thing,
* a Long.
*/
public Long getObjidAsLong() {
return new Long( getObjid().longValue() );
}
</#if><#if clazz.generatedName == "AdpTblNameMap" || clazz.generatedName == "AdpTblOid"> <#-- PSK This is a cheap and easy equals method for Adp tables.
--> public boolean equals( Object obj ) {
return getTypeId().equals( ((${clazz.generatedName})obj).getTypeId() );
}
<#-- PSK This is a cheap and easy hashcode method for Adp tables.
--> public int hashCode() {
if( getTypeId() != null ) {
return getTypeId().intValue();
} else {
(new Exception()).printStackTrace( System.out );
return 0;
}
}
</#if><#if clazz.generatedName == "AdpDbHeader"> <#-- ST This is a cheap and easy equals method for the AdpDbHeader table.
--> public boolean equals( Object obj ) {
return getDbName().equals( ((${clazz.generatedName})obj).getDbName() );
}
<#-- PSK This is a cheap and easy hashcode method for Adp tables.
--> public int hashCode() {
if( getDbName() != null ) {
return getDbName().hashCode();
} else {
(new Exception()).printStackTrace( System.out );
return 0;
}
}
</#if><#if clazz.generatedName == "ContrSchedule"> public Set getLineItms() {
java.util.Set lineItms = new java.util.HashSet();
for( java.util.Iterator i = getContrItms().iterator(); i.hasNext(); ) {
ContrItm contrItm = (ContrItm)i.next();
if (contrItm.getContrItmByChild2contrItm() == null) {
lineItms.add( contrItm );
}
}
return lineItms;
}
</#if>
<#foreach queryName in cfg.namedQueries.keySet()>
<#if queryName.startsWith(clazz.entityName)>
<#assign methname = c2j.unqualify(queryName)>
<#assign params = cfg.namedQueries.get(queryName).parameterTypes><#assign argList = c2j.asFinderArgumentList(params, clazz)>
</#if>
</#foreach>
}
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
[hibernatetool] 2006-06-22 12:19:42,546 ERROR [main] (freemarker.runtime) -
[hibernatetool] Method public java.lang.String org.hibernate.tool.hbm2x.pojo.Bas
icPOJOClass.getPackageDeclaration() threw an exception when invoked on org.hiber
nate.tool.hbm2x.pojo.EntityPOJOClass(com.comcast.commsales.hibernate.GbstLst)
[hibernatetool] The problematic instruction:
[hibernatetool] ----------
[hibernatetool] ==> ${pojo.getPackageDeclaration(clazz)} [on line 1, column 1 in
pojo/Pojo.ftl]
[hibernatetool] ----------
[hibernatetool] Java backtrace for programmers:
[hibernatetool] ----------
[hibernatetool] freemarker.template.TemplateModelException: Method public java.l
ang.String org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getPackageDeclaration()
threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass
(com.comcast.commsales.hibernate.GbstLst)
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMet
hodModel.java:136)
[hibernatetool] at freemarker.core.MethodCall._getAsTemplateModel(Method
Call.java:93)
[hibernatetool] at freemarker.core.Expression.getAsTemplateModel(Express
ion.java:89)
[hibernatetool] at freemarker.core.Expression.getStringValue(Expression.
java:93)
[hibernatetool] at freemarker.core.DollarVariable.accept(DollarVariable.
java:76)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:19
6)
[hibernatetool] at freemarker.core.MixedContent.accept(MixedContent.java
:92)
[hibernatetool] at freemarker.core.Environment.visit(Environment.java:19
6)
[hibernatetool] at freemarker.core.Environment.process(Environment.java:
176)
[hibernatetool] at freemarker.template.Template.process(Template.java:23
2)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateHelper.processTempla
te(TemplateHelper.java:243)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produceToSt
ring(TemplateProducer.java:67)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(Tem
plateProducer.java:28)
[hibernatetool] at org.hibernate.tool.hbm2x.TemplateProducer.produce(Tem
plateProducer.java:97)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(G
enericExporter.java:112)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportPersis
tentClass(GenericExporter.java:101)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.exportClasse
s(GenericExporter.java:84)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.doStart(Gene
ricExporter.java:69)
[hibernatetool] at org.hibernate.tool.hbm2x.AbstractExporter.start(Abstr
actExporter.java:93)
[hibernatetool] at org.hibernate.tool.hbm2x.GenericExporter.start(Generi
cExporter.java:59)
[hibernatetool] at org.hibernate.tool.ant.ExporterTask.execute(ExporterT
ask.java:40)
[hibernatetool] at org.hibernate.tool.ant.HibernateToolTask.execute(Hibe
rnateToolTask.java:160)
[hibernatetool] at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:275)
[hibernatetool] at org.apache.tools.ant.Task.perform(Task.java:364)
[hibernatetool] at org.apache.tools.ant.Target.execute(Target.java:341)
[hibernatetool] at org.apache.tools.ant.Target.performTasks(Target.java:
369)
[hibernatetool] at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1216)
[hibernatetool] at org.apache.tools.ant.Project.executeTarget(Project.ja
va:1185)
[hibernatetool] at org.apache.tools.ant.helper.DefaultExecutor.executeTa
rgets(DefaultExecutor.java:40)
[hibernatetool] at org.apache.tools.ant.Project.executeTargets(Project.j
ava:1068)
[hibernatetool] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[hibernatetool] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[hibernatetool] at org.apache.tools.ant.launch.Launcher.run(Launcher.jav
a:246)
[hibernatetool] at org.apache.tools.ant.launch.Launcher.main(Launcher.ja
va:67)
[hibernatetool] Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
[hibernatetool] at freemarker.ext.beans.BeansWrapper.unwrapArguments(Bea
nsWrapper.java:573)
[hibernatetool] at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMet
hodModel.java:109)
[hibernatetool] ... 33 more
Finding class freemarker.core.StopException
Loaded from D:\commsales\lib\freemarker.jar freemarker/core/StopException.class
Class freemarker.core.StopException loaded from ant loader (parentFirst)
[hibernatetool] An exception occurred while running exporter #2:generic exporter
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.tool.hbm2x.ExporterException: Error while processi
ng template pojo/Pojo.ftl
[hibernatetool] freemarker.template.TemplateModelException: Method public java.l
ang.String org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getPackageDeclaration()
threw an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass
(com.comcast.commsales.hibernate.GbstLst)
[hibernatetool] java.lang.ArrayIndexOutOfBoundsException: 0
BUILD FAILED
D:\commsales\build.xml:427: org.hibernate.tool.hbm2x.ExporterException: Error wh
ile processing template pojo/Pojo.ftl
at org.hibernate.tool.ant.HibernateToolTask.reportException(HibernateToo
lTask.java:194)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja
va:163)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: org.hibernate.tool.hbm2x.ExporterException: Error while processing te
mplate pojo/Pojo.ftl
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe
r.java:249)
at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplatePro
ducer.java:67)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.ja
va:28)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.ja
va:97)
at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.j
ava:112)
at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(Generi
cExporter.java:101)
at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporte
r.java:84)
at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java
:69)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java
:93)
at org.hibernate.tool.hbm2x.GenericExporter.start(GenericExporter.java:5
9)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja
va:160)
... 12 more
Caused by: freemarker.template.TemplateModelException: Method public java.lang.S
tring org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getPackageDeclaration() threw
an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.
comcast.commsales.hibernate.GbstLst)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:13
6)
at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:232)
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe
r.java:243)
... 23 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at freemarker.ext.beans.BeansWrapper.unwrapArguments(BeansWrapper.java:5
73)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:10
9)
... 33 more
--- Nested Exception ---
org.hibernate.tool.hbm2x.ExporterException: Error while processing template pojo
/Pojo.ftl
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe
r.java:249)
at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(TemplatePro
ducer.java:67)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.ja
va:28)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(TemplateProducer.ja
va:97)
at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(GenericExporter.j
ava:112)
at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(Generi
cExporter.java:101)
at org.hibernate.tool.hbm2x.GenericExporter.exportClasses(GenericExporte
r.java:84)
at org.hibernate.tool.hbm2x.GenericExporter.doStart(GenericExporter.java
:69)
at org.hibernate.tool.hbm2x.AbstractExporter.start(AbstractExporter.java
:93)
at org.hibernate.tool.hbm2x.GenericExporter.start(GenericExporter.java:5
9)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:40)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.ja
va:160)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: freemarker.template.TemplateModelException: Method public java.lang.S
tring org.hibernate.tool.hbm2x.pojo.BasicPOJOClass.getPackageDeclaration() threw
an exception when invoked on org.hibernate.tool.hbm2x.pojo.EntityPOJOClass(com.
comcast.commsales.hibernate.GbstLst)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:13
6)
at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:232)
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(TemplateHelpe
r.java:243)
... 23 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at freemarker.ext.beans.BeansWrapper.unwrapArguments(BeansWrapper.java:5
73)
at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:10
9)
... 33 more
Total time: 7 seconds
Name and version of the database you are using:
Oracle 8
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: