-->
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: Minimal database creation
PostPosted: Thu Jun 08, 2006 4:18 am 
Newbie

Joined: Tue Apr 27, 2004 4:31 am
Posts: 13
Hello,

We have a database with over 300 tables we would like to test through unit-like tests. Therefore I would like to instantly create an in memory database (HSQL) with only the few classes/tables that are tested in that particular test.

The problem is that all mappings are related so that the only thing I can do is to include all classes in the hibernate.cfg.xml. Else exceptions like these occur:

Code:
Association references unmapped class: com.foo.bar.WonderfulThesis


Is it possible to modify the configuration of mappings-loading (as is done by the SessionFactory) so that referenced unmapped classes are ignored?

In production this is something you do not want to happen, but from within tests it would be a nice feature.

Greetings,
Erwin


Top
 Profile  
 
 Post subject: Why do I need this
PostPosted: Tue Jun 13, 2006 3:57 am 
Newbie

Joined: Tue Apr 27, 2004 4:31 am
Posts: 13
Let me explain why I need this.

Our application consists of two separate domains. Let's say Domain A and Domain B. Domain A depends on Domain B.

Given this example, Domain B is testable. With an in memory database (we use HSQL) and providing only the classes to map within the tests, a sort of Unit tests are created.

Domain A is much less isolated, because of the dependency on Domain B. Setting up all classes to map takes very long and is not needed for the tests to be done.

I really would like the SessionFactory to only warn if an unmapped class is referenced by a certain mapping.

Is that possible, or should I patch the SessionFactory for this?

Erwin


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.