More on Hibernate in CF
So I have hibernate working with cf now. I am pretty happy
with the results so far. But I have a real hang up about having
to have all the config stuff in the classes directory inside the
server. This is a large part of why I embarked on the
classLoader.cfc. So what I found was that i can get around that
partly by utilizing the methods of the hibernate Configuration object.
By default when hibernate loads it looks in the classpath for its xml
config and properties files. However buy using the addResource,
addClass, addXml methods you can load up all that information with out
the config files. So what I have done is drop my classes and
class mapping files into the lib directory for my test website.
After I initiate my hbConfig = org.hibernate.cfg.Configuration I can
then use my classLoader.cfc to load the User class from my lib
direcotry. Now as an object this doesnt do me alot of good. but
by calling user.getClass() I have something I can pass into
hbconfig.addClass(). When I do this hibernate looks for the
User.hbm.xml localling in the lib directory. And then continues
execution happily.
So you might be thinking that we are set then, but that is not the
case. When it comes time to create your session from which you
will call your queries and such, it errors. It now tries to load
the User object, but because cf loaded my hibernate config object, it
looks for the User object on the classpath again. And seeing as
that is what i am trying to not have to do, this throughs an error
because the file is not there.
So i am thinking that if I can find some way to load the hibernate
config object with my class loader then I could alleviate this
problem. However I am not sure how to go about this
exactly. Anybody have any ideas?

Interesting question especially since I just got Hibernate working on the Windows J2EE version thanks your instructions. I will let you know if I figure out a way.