-->
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: Dynamic models...
PostPosted: Thu Apr 28, 2005 4:55 pm 
Newbie

Joined: Thu Apr 28, 2005 4:06 pm
Posts: 1
Location: Curitiba / Brazil
Hi,

I'm building a dynamic database tool, this tool is part of a customized web tool framework, built over spring framework (www.springframework.org) and it is using hibernate as persistence mechanism.
The tool has the funcionality to define a entity, properties or relationships, and then it build dynamically the Entity bytecode, and create related tables and hibernate mappings. To make this work, we need a way to hibernate handle dynamic mapping modifications, but after read a lot, i see that this is not a present feature nor a planned future feature.
Now i must find a way to implement dynamic mapping in hibernate. After searching for ways to do this i stuck with some aproaches and lot of questions.

1st - Use the hibernate dynamic-class or dynamic-component to implement the idea, but this feature is not well documented, do not have examples and i don't know if mapping modification at runyime is possible (I think not).
2st - I have a already running session factory (1st - SF), this session factory is reponsible for all my framework entities, i think in creating a separate SF (2nd) and bind two to a JTA transaction platform. But, my second SF, that can be reloaded, must have access/association with the 1st session factory. Example: User Entity on 1st SF is references by DynTbl001 on 2nd SF. Is there a way to do this ? Can two SF be linked ? Is there a way to detect a loading or saving operation in on SF and redirect to other SF ?
3st - Someone in some forum, tell me to build a new SF on mapping changes, and then let the new SF to serve new Sessions to Bussiness Objects. Yes it could be done, but i have to manage Session Factory through a wraper object, and must manage session openning and closing. This because, the wrapper acts as a Delegate Object, delegating call to one SF instance. On reloading this instance continues normal operation until that NEW SF becomes ready. The problem is in closing first SF to release resources i need to manage how much sessions if open and related to 1st SF. This approach, clear all caching, and seems that already detached collections can not be able to be reassigned to the new Session of the new SF.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 30, 2005 11:02 pm 
Newbie

Joined: Thu Jan 20, 2005 11:01 am
Posts: 15
You may want to take a look at the <a href="http://ycmi.med.yale.edu/nadkarni/eav_CR_contents.htm">EAV/CR</a> pattern. This pattern is especially good if the end users will not be looking at the relational database but will see the database only through the application. If you implement the EAV/CR pattern then you can control everything through the app in a pretty simple but dynamic model.


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.