-->
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.  [ 8 posts ] 
Author Message
 Post subject: OFF: dynamic data model in NHibernate
PostPosted: Tue Sep 06, 2005 3:14 pm 
I'm very junior in o/r mapping and persistent object tools.
But I love very NHibernate. It helpes me very in the project I do.

One thing which torments me is that NHibernate if I correctly understood is the_static_o/r library it doesn't allow changing the structure of classes and relations dynamically.

But in many cases project require this feature.

I read something about data scheme classes in original Java Hibernate,
but nothing found in NHibernate (if it is in NH please write me).

I think that is not a problem - to change attributes of c# classes dynamically or maybe to switch to classes with collections of dynamic properties.

My post is generally not a question but attemt to discuss the question of dynamically changing of data scheme in NHibernate.

Sergey


Top
  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 3:48 pm 
Newbie

Joined: Sat Aug 20, 2005 10:39 am
Posts: 12
Location: Brazil
Hi,

I am initiating a new project ERP and we go to need this. I am with the same questions. :(


[]s


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 12:17 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
We can't find a solution when there is no problem...

Do you have a specific case where you need this "feature" ?

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 2:17 pm 
Newbie

Joined: Sat Aug 20, 2005 10:39 am
Posts: 12
Location: Brazil
Hi,

Sample:
For standard, my system has two fields: Name and ID. But my user wants another field called DateSaved. Then I need to leave the system customisable for this situation. Clearly that this is a possible simpler example. But in the case of a great ERP system this is highly necessary. This type of system has as characteristic basic the customisation for each customer.
Some form to use NHibernate in this way?

[]s

* Sorry my bad english.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 9:40 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
I still don't see the problem; here, you have to:

- Add a column in the database
- Add a field+property+logic to the entity
- Add the Mapping
- Update the UI
- Compile & Deploy

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 9:57 am 
Newbie

Joined: Sat Aug 20, 2005 10:39 am
Posts: 12
Location: Brazil
The problem is in the last part. The system already is running in the customer. I cannot compile. Necessary to leave an interface where it can create fields without to be necessary the compilation.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 10:19 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Well, I can't figure out how you can make the changes available without creating a new SessionFactory (which means that customers will be disconnected; so that's like rebooting the system)

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 10:34 am 
Newbie

Joined: Thu Aug 25, 2005 5:05 am
Posts: 6
Instead of storing each column data for the "customizable" objects in an instance field you store them all in a IDictionary, this way you can have a static mapping and a normal compiled object for handling the data.

Even if you could have a dynamic mapping (which you could if you dont mind generating part of the mapping and recreating the factories) you would not be able to take advantage of having properties for each "column" anyways because you would have to compile the classes on runtime to be able to create properties in them..

So its better to just use a IDictionary directly if you want to allow the users of the system to create more fields for your object.


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