-->
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: Proble adding Criterias with Formula properties
PostPosted: Wed Aug 15, 2007 2:49 pm 
Regular
Regular

Joined: Tue May 31, 2005 9:55 am
Posts: 67
Are Criterias that contain a Formula property supposed to work. When I query using this type of Criteria, it does not properly use the forumla.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 16, 2007 8:35 am 
Regular
Regular

Joined: Tue May 31, 2005 9:55 am
Posts: 67
Well, it turned out that it was my fault for leading NHibernate on a wild goose chase. It is just a testimony to the greatness of NHibernate and its tenacity to produce a valid query even in the face of ambiguity.

Basically, I have a discrminated hierarchy with implicit polymorphism as follows

Code:

Canister
   public virtual int State { get; set }  => Not in mapping

SimpleCanister << Canister
   public override int State  { get; set; }  => Simple mapping

SmartCanister << Canister
   public override int State  { get; set; }  => Formula mapping

I have to specialized Canisters, with one using a Formula to obtain the state (FYI These are Canisters with Chips that can advertise there State in a database)

I was intending on querying for SmartCanisters using the State, but I used a DetachedCriteria for the Canister class.  As you would imagine, what NHibernate would use in the condition is a bit ambiguous.  It actually used the Simple State property instead of the Forumula which was the source of the original post.  Once I created the DetachedCriteria for SmartCanister, it worked as expected.

cheers,
  craig



Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 16, 2007 8:35 am 
Regular
Regular

Joined: Tue May 31, 2005 9:55 am
Posts: 67
Well, it turned out that it was my fault for leading NHibernate on a wild goose chase. It is just a testimony to the greatness of NHibernate and its tenacity to produce a valid query even in the face of ambiguity.

Basically, I have a discrminated hierarchy with implicit polymorphism as follows

Code:

Canister
   public virtual int State { get; set }  => Not in mapping

SimpleCanister << Canister
   public override int State  { get; set; }  => Simple mapping

SmartCanister << Canister
   public override int State  { get; set; }  => Formula mapping



I have to specialized Canisters, with one using a Formula to obtain the state (FYI These are Canisters with Chips that can advertise there State in a database)

I was intending on querying for SmartCanisters using the State, but I used a DetachedCriteria for the Canister class. As you would imagine, what NHibernate would use in the condition is a bit ambiguous. It actually used the Simple State property instead of the Forumula which was the source of the original post. Once I created the DetachedCriteria for SmartCanister, it worked as expected.

cheers,
craig

[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 16, 2007 8:35 am 
Regular
Regular

Joined: Tue May 31, 2005 9:55 am
Posts: 67
Well, it turned out that it was my fault for leading NHibernate on a wild goose chase. It is just a testimony to the greatness of NHibernate and its tenacity to produce a valid query even in the face of ambiguity.

Basically, I have a discrminated hierarchy with implicit polymorphism as follows

Code:

Canister
   public virtual int State { get; set }  => Not in mapping

SimpleCanister << Canister
   public override int State  { get; set; }  => Simple mapping

SmartCanister << Canister
   public override int State  { get; set; }  => Formula mapping



I have to specialized Canisters, with one using a Formula to obtain the state (FYI These are Canisters with Chips that can advertise there State in a database)

I was intending on querying for SmartCanisters using the State, but I used a DetachedCriteria for the Canister class. As you would imagine, what NHibernate would use in the condition is a bit ambiguous. It actually used the Simple State property instead of the Forumula which was the source of the original post. Once I created the DetachedCriteria for SmartCanister, it worked as expected.

cheers,
craig

[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 16, 2007 8:38 am 
Regular
Regular

Joined: Tue May 31, 2005 9:55 am
Posts: 67
Sorry for the duplicates, I.E. was freaking out on me and I did 1 too many Submits.


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.