I'm having trouble with writing an ICriteria query that will get me a
fully initialized (non-proxy) object for inheritance types for this
scenario...

Table Structure
======================

[Bulletin] -----
                    |
            [Publication]> --------< [PublicationPublication]
>----------------[PublicationRelationshipType]
                    |
[Form] -------

Bulletin and Form are related 1 to 1 to a publication and only provide
additional data (mapped as joined subclasses in my hbm.xml files off
of publication)

PublicationPublication is a join table to relate publications to other
publications.

PublicationRelationshipType just says how they are related to each
other.

Problem
======================
Normally, I'm able to select do a Get for a Publication and it will
resolve the type to a Bulletin or Form so I know (or think i know) my
inheritance mappings are setup properly.

What I can't figure out is when I do an ICriteria query from
PublicationPublication back to Publication using SetProjection to only
retrieve back the column association for the publications that I want,
it doesn't seem to resolve to the appropriate type (form or bulletin)
rather just gives me a proxy.  NHibernateUtil.Initialize also will not
resolve it to its proper type.

I've also tried tinkering around with setting FetchMode to Eagar or
DistinctRootEntityTranformer but still no luck.  The SQL query that is
executed is doing all the proper left outer joins for inheritance and
getting back the right columns but the object is still a proxy.

I tried to keep my initial post lighter so people didn't have to read
a book to decide if they wanted to help.  If you do, I can follow up
with more details.

Thanks in advance,
Scott
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to