-->
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: Dividing large config file into multiple files?
PostPosted: Tue Mar 16, 2010 12:31 pm 
Newbie

Joined: Fri May 25, 2007 4:45 pm
Posts: 3
We have a large enterprise application with approximately 6,000 users and a few hundred thousand lines of code. This app is working very well. We currently use Spring/Hibernate and annotations rather than hbm files. We are going through an exercise in refactoring our source code, dividing the source into multiple projects, with each project representing a specific functional module within the application. We have a large suite of unit tests attached to each module as well.

Problem we are running into is that the list of annotated classes/packages in our session factory bean is getting very long. We would like to divide it up into multiple files, one file per module and then reference (like an import) the various files from the sessionFactory config.

There are several goals that we are trying to achieve, two of which are organizational and long term ease of maintenance.

Any hints would be greatly appreciated.


Top
 Profile  
 
 Post subject: Re: Dividing large config file into multiple files?
PostPosted: Tue Mar 16, 2010 5:34 pm 
Regular
Regular

Joined: Thu May 07, 2009 5:56 am
Posts: 94
Location: Toulouse, France
hi, you can reference several .hbm files in your hibernate.cfg.xml. just add this:

<mapping resource="module/first.hbm.xml" />
<mapping resource="module/second.hbm.xml" />

_________________
everything should be made as simple as possible, but not simpler (AE)


Top
 Profile  
 
 Post subject: Re: Dividing large config file into multiple files?
PostPosted: Thu Mar 18, 2010 10:42 am 
Newbie

Joined: Fri May 25, 2007 4:45 pm
Posts: 3
We don't use hbm files which is what is complicating the issue, we use annotated classes. We have found a method to include a single file of mapped classes, but not multiple files of mapped classes.


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.