-->
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: Question: "partial" xml files
PostPosted: Fri May 05, 2006 9:53 am 
Beginner
Beginner

Joined: Wed May 03, 2006 5:10 am
Posts: 32
Location: Monopoli - Italy
Hi,

I have a question: does exist the concept of "partial" file for xml files?

Antonella


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 05, 2006 12:23 pm 
Senior
Senior

Joined: Fri Jan 13, 2006 2:50 pm
Posts: 123
Location: Blumenau / SC / Brasil
I was reading the NH Doc. and found this:

Quote:
4.4. Modular mapping files
It is possible to define subclass and joined-subclass mappings in seperate mapping documents, directly beneath hibernate-mapping. This allows you to extend a class hierachy just by adding a new mapping file. You must specify an extends attribute in the subclass mapping, naming a previously mapped superclass. If you are configuring NHibernate by using Embedded Resources then the hbm.xml files are configured in the correct order. If you are manually adding them or specifying them in the cfg.xml file then the ordering of the mapping documents is important!


I hope this help you.

Bye


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 09, 2006 8:11 am 
Beginner
Beginner

Joined: Wed May 03, 2006 5:10 am
Posts: 32
Location: Monopoli - Italy
I'm sorry, but this isn't my problem.

I have a xml generated file containing the User class.
In my database I have the view Auth_Permission containing a UserId field, but a <bag> section related to a view cannot be generated automatically because it has no relations with the User table, so, to solve the problem I added manually the following section in my auto-generated file:

<bag name="permissions" inverse ="false" cascade="all">
<key column="IdUser" />
<one-to-many class="ObjectModel.Auth.Permission, ObjectModel" />
</bag>

My problem is that I will lose this section at any new file generation.

In my code I have the same problem with generated classes, but I solved the problem with Partial Classes:
I created two partial classes "User", one containing the generated code and another containg the code manually writed: the "permissions" collection.

I would like to do the same thing with xml files....

Thanks for help
Antonella


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 09, 2006 4:31 pm 
Regular
Regular

Joined: Fri Jul 29, 2005 9:46 am
Posts: 101
Hi!
Why dont you try: http://nhibernate.sourceforge.net/nh-do ... butes.html
I am using it an I really like 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.