-->
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: Priority of xml mapping with regard to*.cs and db scheme
PostPosted: Tue Oct 11, 2005 3:24 pm 
Beginner
Beginner

Joined: Tue Aug 23, 2005 8:15 am
Posts: 45
Guys, what do you think about the concentration on creation
of xml mapping files
in development of application based on NHibernate.
The idea is that the main role play NHiberante mapping files.
All other stuff: CSharp entity classes and database scheme
scripts should be created automatically from mapping files.
So the magic tool or library could provide:
1) generation of cs files
2) automated creation of .net assembly
3) generation of database creation scripts (including tables and constraints
)
4) generation of indexes to the database for foreign keys in collections
5) generation of alter table script in case of xml mapping changes
( the script could use previos and new versions of xml-files or the combination: new version of xml-files and current db-scheme)

These could help to create more dynamically applications based on NHibernate. The application could change the data model on-the-fly
and link with with NHibernate DAO not statically but via reflection.

I plan to use this approach to create adaptive information-analytical system.[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 12, 2005 8:45 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
I assume you are talking about a tool using available tools...

1) hbm2net
2) NAnt
3) hbm2ddl
4) hbm2ddl ?!?
5) SchemaUpdate (not available)

On side note, I really prefer writing cs files and use NHibernate.Mapping.Attributes to generated the hbms and database scripts :wink:

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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 3:34 am 
Hi KPixel.. can you provide example code how to generate hbm.xml file and database schema from *.cs file..

or any example in NHibernate Project Solution..


Top
  
 
 Post subject:
PostPosted: Wed Oct 26, 2005 10:26 am 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
Both the NHibernate.Mapping.Attributes tool and Castle's ActiveRecord generate the xml mapping for you. The unit tests for each should provide examples of generating the database schema. See http://svn.castleproject.org/svn/castle/trunk/ActiveRecord/Castle.ActiveRecord.Tests/AbstractActiveRecordTest.cs to see how ActiveRecord does it.


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.