-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to disable autodetection of mapped entities at startup?
PostPosted: Wed Aug 11, 2010 5:16 am 
Newbie

Joined: Wed Aug 11, 2010 5:04 am
Posts: 1
I would like disable the autodetection and explicitly list my mapped entities in the Hibernate config file:

Code:
<class>xx.yyy.zzz.EntityClassA</class>
<class>xx.yyy.zzz.EntityClassB</class>
<class>xx.yyy.zzz.EntityClassC</class>
<class>xx.yyy.zzz.EntityClassD</class>
...

Instead of this on every startup:
Code:
2010-08-11 10:56:03,970 DEBUG Ejb3Configuration - Detect class: false; detect hbm: false
2010-08-11 10:56:03,986 DEBUG AbstractJarVisitor - Searching mapped entities in jar/par: file:/path/to/my/classes
2010-08-11 10:56:03,986 DEBUG AbstractJarVisitor - Filtering: xx.yyy.zzz.NotEnityClassA
2010-08-11 10:56:03,986 DEBUG AbstractJarVisitor - Filtering: xx.yyy.zzz.NotEnityClassB
2010-08-11 10:56:03,986 DEBUG AbstractJarVisitor - Filtering: xx.yyy.zzz.NotEnityClassC
2010-08-11 10:56:04,002 DEBUG AbstractJarVisitor - Filtering: xx.yyy.zzz.NotEnityClassD
...


I tried the setting
Code:
<property name="hibernate.archive.autodetection" value=""/>

But as you can see the autodetection still executes.

I also found the hibernate.ejb.resource_scanner setting, but do I really need to create my own DoNothingScanner to disable the autoscan???

Maybe someone can explain to me why the autodetection seems to be so important that it can't be disabled easily?


Top
 Profile  
 
 Post subject: Re: How to disable autodetection of mapped entities at startup?
PostPosted: Wed May 18, 2011 7:51 pm 
Newbie

Joined: Wed May 18, 2011 7:48 pm
Posts: 1
use the
Quote:
<exclude-unlisted-classes>true</exclude-unlisted-classes>
tag in your persistence.xml


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