-->
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.  [ 5 posts ] 
Author Message
 Post subject: Couple of quick questions
PostPosted: Mon Jan 15, 2007 11:29 am 
Beginner
Beginner

Joined: Mon Jan 08, 2007 11:59 pm
Posts: 31
Hi,
I have a couple of questions:

1. Does N support formula in Discriminator column, i.e. is it possible to set up a subclass "Wife" on Discriminator mapping "Sex=F and SpouseID is not null"

2. Suppose I have an entity A which has a one-to-many relation with B, so I have a set of B's in A. A has a version control, I find that the version of A is updated when I add a new B to the collection, is it possible to suppress this, i.e. is it possible to not update the version column when the collection is modified?

Regards
Job Samuel.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 11:47 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Answers for the latest version (1.2.0.Beta3):
1. Yes.
2. Using <set optimistic-lock="false" ...> should do it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 11:23 am 
Beginner
Beginner

Joined: Mon Jan 08, 2007 11:59 pm
Posts: 31
I tried
Code:
<set
         name="Bids"
         optimistic-lock="false"
         cascade="save-update"
         inverse="true">
         <key
            column="ItemID" />
         <one-to-many
            class="Bid" />
      </set>


but I am getting XML validation error.

I got the discriminator formula working, thanks.

Job Samuel.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 11:54 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Right you are! Will fix this in the next version (1.2.0.CR1):
http://jira.nhibernate.org/browse/NH-868


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 10:26 pm 
Beginner
Beginner

Joined: Mon Jan 08, 2007 11:59 pm
Posts: 31
Thanks Sergey.

Job Samuel


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