-->
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.  [ 3 posts ] 
Author Message
 Post subject: how to map annotated classes and mapping files in single cfg
PostPosted: Tue Nov 24, 2009 5:21 am 
Newbie

Joined: Wed Nov 11, 2009 6:41 am
Posts: 7
HI i am facing a problem as
i developed my app using Hibernate3.2 but now i have some classes on Hibernate3.3
i maped them as

I am getting error's to code like this pls suggest me.
how to map annotated classes and mapping files.
hibernate.cfg.xml:
<hibernate-configuration>
<session-factory>
mapping resource="org.xxx.StatusCodes.hbm.xml"/>
<mapping resource="org.xxx.model.SamTable.hbm.xml"/>

<mapping class="org.xxx.model.User"/>
<mapping class="org.xxx..model.Role"/>
</session-factory>
</hibernate-configuration>

I am developing my app on Spring with Hibernate.
in ApplicationContext.xml file i am getting this Hibernate.cfg.xml file


Top
 Profile  
 
 Post subject: Re: how to map annotated classes and mapping files in single cfg
PostPosted: Tue Nov 24, 2009 5:26 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
please post your errors and use the '[code][/code]'-tag next time.

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
 Post subject: Re: how to map annotated classes and mapping files in single cfg
PostPosted: Tue Nov 24, 2009 7:33 am 
Newbie

Joined: Wed Nov 11, 2009 6:41 am
Posts: 7
This is my error mmerder.

Code:
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] resource: org.xxx.model.SamTable.hbm.xml not found
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.hibernate.MappingNotFoundException: resource: org.xxx.model.SamTable.hbm.xml not found
        at org.hibernate.cfg.Configuration.addResource(Configuration.java:517)
        at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(Annotat
ionConfiguration.java:524)
        at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.jav
a:1479)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1458)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1432)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:1386)
        at org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfigura
tion.doConfiguration(AbstractComponentConfiguration.java:74)
        at org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfigura
tion.getConfiguration(AbstractComponentConfiguration.java:37)
        at org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(H
bm2DDLExporterMojo.java:87)
        at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateE
xporterMojo.java:140)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.