I asked a similar question a few days ago.

Fabio Maulo said:

2 paths...polymorphism="explicit" (but you must deal with it if then you
want a poly-query)
entity-name (allow you duplicated mapping of same class... to "solve" the
first path ;) )

Hope that helps

2009/3/14 paszczi <[email protected]>

>
>
>
> Hello!
>
> I'm currently trying to solve a problem. I have a class table
> inheritance aka table-er-subclass (one main table + several others
> with additional data). In my app both base object instances and
> extended objects can exist. Now I want to be able to sometimes fetch
> only those base objects and sometimes both types. A simple example
> (both classes are mapped with all of their properties)
>
> public class Base
> {
>  public in ID {get; set;}
>  public string Something {get; set;}
> }
>
> public class Extended : Base
> {
>  public bool NewProp{get; set;}
> }
>
> now running hql query "from Base" would fetch both Base and Extedned
> objects. Is there any way to restrict such behavior to fetch only Base
> objects?
>
> >
>


-- 
James Crowley
Managing Director
Developer Fusion - Connecting developers worldwide

Developer Fusion Ltd | 58 Sandringham Close | Enfield, EN1 3JH
mob: 07986 624128 web: http://www.developerfusion.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to