-->
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.  [ 1 post ] 
Author Message
 Post subject: autoscan with no jpa (or migrate to jpa)
PostPosted: Mon Jul 12, 2010 7:50 am 
Newbie

Joined: Tue Oct 06, 2009 1:40 pm
Posts: 10
Hi everyone.

I am maintaining an old project I just ported to latest hibernate+spring.
The project does not use JPA but configure hibernate directly, via Spring, declaring a dataSource and a sessionFactory (LocalSessionFactoryBean) and injecting the sessionFactory into the HibernateTemplate, the HibernateTransactionManager etc..

My problem is that the old config has this sessionFactory property to locate the hbm.xml files

<property name="mappingDirectoryLocations" value="classpath*:com/company/service/dto/" />

Now this works but cannot be inherited to another project.
So if this context file is defined in project A and B depends on A, when I deploy and start B.war, I get:

FileNotFoundException: jar:file:/home/ildella/.m2/repository/com/company/service/1.0-SNAPSHOT/service-1.0-SNAPSHOT.jar!/com/company/service/dto/

this does not happen in in test environment, where everything works both in A and B.

I am used to JPA autoscan and I never care about where I declare my hbm files.

So my questions are:

1. there is a way to get the auto-scan with hibernate without JPA?
2. what is the best way to migrate that config to one that uses the LocalEntityManagerFactoryBean?

Thanks.


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

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.