-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Unable to generate hbm for tables with composite primary key
PostPosted: Sat Jan 09, 2010 3:25 am 
Newbie

Joined: Sat Jan 02, 2010 6:09 am
Posts: 13
Hi,


I am using hibernate tools 3.2.4.ga plugin in my eclipse. I am generating pojo's and hbm's using eclipse, but I am unable to generate hbm file for tables with composite primary key.
Please suggest me what I need to do to generate these hbm's.I am getting the following exception. org.hibernate.tool.hbm2x.ExportException :
Error while processing entity: Data with template hbm/hibernate-mapping.hbm.ftl


Top
 Profile  
 
 Post subject: Re: Unable to generate hbm for tables with composite primary key
PostPosted: Fri Jan 29, 2010 11:19 am 
Senior
Senior

Joined: Fri May 08, 2009 12:27 pm
Posts: 168
I'm using composite primary keys, too, but reverse engineering runs just fine here.

Maybe the "Generate basic typed composite ids" setting in your code generation configuration is different, I have that checked.
I'm also using explicit <primary-key> sections in hibernate.reveng.xml. Maybe something is wrong in your hibernate.reveng.xml.


Top
 Profile  
 
 Post subject: Re: Unable to generate hbm for tables with composite primary key
PostPosted: Wed Feb 03, 2010 5:58 am 
Newbie

Joined: Sat Jan 02, 2010 6:09 am
Posts: 13
I have checked "Generate basic typed composite ids" while Hibernate Code Generation, but still I am getting the same Exception


Top
 Profile  
 
 Post subject: Re: Unable to generate hbm for tables with composite primary key
PostPosted: Wed Feb 03, 2010 6:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
You need to show the stacktrace and/or relevant reveng.xml setup.

Without it I got no idea.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Unable to generate hbm for tables with composite primary key
PostPosted: Fri Feb 05, 2010 9:36 am 
Newbie

Joined: Sat Jan 02, 2010 6:09 am
Posts: 13
HI Max,

I am giving here the contents of my hibernate.reveng.xml file and full stack trace for errors. Another detailed information on errors I have to give via a Screen Shot, but I don't find any way to attach it here.

Please try to help me on below details


Contents of hibernate.reveng.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>
<table-filter match-schema="ECSTEST" match-name=".*"/>
</hibernate-reverse-engineering>

My Schema ECSTEST contains the tables having Composite Primary Key


Errors Report

org.hibernate.tool.hbm2x.ExporterException: Error while processing Entity: T20100125183747Exception with template hbm/hibernate-mapping.hbm.ftl

Error while processing Entity: T20100125183747Exception with template hbm/hibernate-mapping.hbm.ftl
freemarker.core.InvalidReferenceException: Expression property.value.propertyIterator is undefined on line 58, column 30 in hbm/id.hbm.ftl.

Expression property.value.propertyIterator is undefined on line 58, column 30 in hbm/id.hbm.ftl.
freemarker.core.InvalidReferenceException: Expression property.value.propertyIterator is undefined on line 58, column 30 in hbm/id.hbm.ftl.
Expression property.value.propertyIterator is undefined on line 58, column 30 in hbm/id.hbm.ftl.


2010-02-05 19:38:18,421 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - The JDBC driver didn't report any primary key columns in PROJ_USER_ACCESS. Asking rev.eng. strategy
2010-02-05 19:38:18,421 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - Rev.eng. strategy did not report any primary key columns for PROJ_USER_ACCESS
2010-02-05 19:38:18,515 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - The JDBC driver didn't report any primary key columns in T20100125_181627_EXCEPTION. Asking rev.eng. strategy
2010-02-05 19:38:18,515 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - Rev.eng. strategy did not report any primary key columns for T20100125_181627_EXCEPTION
2010-02-05 19:38:18,515 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - The JDBC driver didn't report any primary key columns in T20100125_183747_EXCEPTION. Asking rev.eng. strategy
2010-02-05 19:38:18,515 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - Rev.eng. strategy did not report any primary key columns for T20100125_183747_EXCEPTION
2010-02-05 19:38:18,531 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - The JDBC driver didn't report any primary key columns in T20100125_184012_EXCEPTION. Asking rev.eng. strategy
2010-02-05 19:38:18,531 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - Rev.eng. strategy did not report any primary key columns for T20100125_184012_EXCEPTION
2010-02-05 19:38:18,531 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - The JDBC driver didn't report any primary key columns in T20100125_184134_EXCEPTION. Asking rev.eng. strategy
2010-02-05 19:38:18,531 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - Rev.eng. strategy did not report any primary key columns for T20100125_184134_EXCEPTION
2010-02-05 19:38:18,546 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - The JDBC driver didn't report any primary key columns in T20100203_122820_EXCEPTION. Asking rev.eng. strategy
2010-02-05 19:38:18,546 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - Rev.eng. strategy did not report any primary key columns for T20100203_122820_EXCEPTION
2010-02-05 19:38:18,546 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - The JDBC driver didn't report any primary key columns in T20100203_123025_EXCEPTION. Asking rev.eng. strategy
2010-02-05 19:38:18,546 WARN Worker-27 org.hibernate.cfg.reveng.JDBCReader - Rev.eng. strategy did not report any primary key columns for T20100203_123025_EXCEPTION
2010-02-05 19:38:19,203 ERROR Worker-27 freemarker.runtime -

Expression property.value.propertyIterator is undefined on line 58, column 30 in hbm/id.hbm.ftl.
The problematic instruction:
----------
==> foreach keyproperty in property.value.propertyIterator [on line 58, column 5 in hbm/id.hbm.ftl]
in include "id.hbm.ftl" [on line 72, column 2 in hbm/persistentclass.hbm.ftl]
in include "persistentclass.hbm.ftl" [on line 34, column 1 in hbm/hibernate-mapping.hbm.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression property.value.propertyIterator is undefined on line 58, column 30 in hbm/id.hbm.ftl.
at freemarker.core.TemplateObject.assertNonNull(Unknown Source)
at freemarker.core.IteratorBlock.accept(Unknown Source)
at freemarker.core.Environment.visit(Unknown Source)
at freemarker.core.MixedContent.accept(Unknown Source)
at freemarker.core.Environment.visit(Unknown Source)
at freemarker.core.IfBlock.accept(Unknown Source)
at freemarker.core.Environment.visit(Unknown Source)
at freemarker.core.Environment.include(Unknown Source)
at freemarker.core.Include.accept(Unknown Source)
at freemarker.core.Environment.visit(Unknown Source)
at freemarker.core.MixedContent.accept(Unknown Source)
at freemarker.core.Environment.visit(Unknown Source)
at freemarker.core.IfBlock.accept(Unknown Source)
at freemarker.core.Environment.visit(Unknown Source)
at freemarker.core.IfBlock.accept(Unknown Source)
at freemarker.core.Environment.visit(Unknown Source)
at freemarker.core.MixedContent.accept(Unknown Source)
at freemarker.core.Environment.visit(Unknown Source)
at freemarker.core.Environment.include(Unknown Source)
at freemarker.core.Include.accept(Unknown Source)
at freemarker.core.Environment.visit(Unknown Source)
at freemarker.core.MixedContent.accept(Unknown Source)
at freemarker.core.Environment.visit(Unknown Source)
at freemarker.core.Environment.process(Unknown Source)
at freemarker.template.Template.process(Unknown Source)
at org.hibernate.tool.hbm2x.TemplateHelper.processTemplate(Unknown Source)
at org.hibernate.tool.hbm2x.TemplateProducer.produceToString(Unknown Source)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(Unknown Source)
at org.hibernate.tool.hbm2x.TemplateProducer.produce(Unknown Source)
at org.hibernate.tool.hbm2x.GenericExporter.exportPOJO(Unknown Source)
at org.hibernate.tool.hbm2x.GenericExporter.exportPersistentClass(Unknown Source)
at org.hibernate.tool.hbm2x.GenericExporter$2.process(Unknown Source)
at org.hibernate.tool.hbm2x.GenericExporter.doStart(Unknown Source)
at org.hibernate.tool.hbm2x.HibernateMappingExporter.doStart(Unknown Source)
at org.hibernate.tool.hbm2x.AbstractExporter.start(Unknown Source)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate$1.execute(Unknown Source)
at org.hibernate.console.execution.DefaultExecutionContext.execute(Unknown Source)
at org.hibernate.console.ConsoleConfiguration.execute(Unknown Source)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.runExporters(Unknown Source)
at org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate.launch(Unknown Source)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(Unknown Source)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(Unknown Source)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(Unknown Source)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.