-->
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.  [ 4 posts ] 
Author Message
 Post subject: General Question: Plugin based architectures
PostPosted: Thu Apr 27, 2006 12:39 pm 
Newbie

Joined: Thu Apr 27, 2006 12:33 pm
Posts: 2
I am new to NHibernate (about 6 hours now) and I've read through a good amount of the documentation, and have done some basic testing and I am mighty-impressed by this framework.

I do have some simple questions though, questions that I have been unable to find in the documentation or this forum:


-1- is there an easy way to define the object/table mapping at runtime and then add this dynamically created configuration?

-2- is there an easy way to detect if a mapped table does not exist within the database? and/or automatically create it if it doesnt exist?

-3- the database classes that currently exist, are they accessible so that I could perhaps create an instance of a provider, wrap it and use it even if it is independant of NHibernate?

Many thanks.


Top
 Profile  
 
 Post subject: Re: General Question: Plugin based architectures
PostPosted: Thu Apr 27, 2006 3:07 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
dotNateNC wrote:
-1- is there an easy way to define the object/table mapping at runtime and then add this dynamically created configuration?

No.

dotNateNC wrote:
-2- is there an easy way to detect if a mapped table does not exist within the database? and/or automatically create it if it doesnt exist?

There's SchemaExport which can create a schema, but it works on the whole set of mapping files, not on individual classes/tables and it can't detect whether the table already exists.

dotNateNC wrote:
-3- the database classes that currently exist, are they accessible so that I could perhaps create an instance of a provider, wrap it and use it even if it is independant of NHibernate?

What do you mean by "provider"? You could probably make some use of Dialects, but other than that, there isn't anything special in how NHibernate talks to databases, it just uses standard ADO.NET API.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 3:16 pm 
Newbie

Joined: Thu Apr 27, 2006 12:33 pm
Posts: 2
Thanks Sergey for your prompt reply.

The dillemma I have is this...

I am starting a new project that uses a plugin based architecture. I was wondering how the hibernate framework could be utilized in such an environment. The biggest problem I am contemplating now is the following scenario:

[My] Initial Application Release contains a pre-built database containing mapped objects that works great (in an ideal world that will be the case).

A new plugin is released that uses different objects. These objects are new and the database is not yet configured with the tables etc. The plugin is then instantiated within my applications framework and then the NHibernate goes to interact with the database only to find the table does not exist.

In an ideal world, a way to to automatically build the table based on the XML mapping file would take place if the table did not exist. As the current documentation is currently so extensive (which is great) I was wondering if I had perhaps missed something?

Do you have any tips/advice on this subject?

Your expertise is greatly appreciated. Thank you.

(900+ posts is impressive, compared to my 2 - lol)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 4:55 pm 
Newbie

Joined: Thu Apr 27, 2006 9:34 am
Posts: 4
SchemaExport.Update should be capable to do that but i far as i know this method has not already been ported to NHibernate.


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