I am trying to change the following SQL query for an ICriteria in NHibernate.
Select MITIPID, Model M from TPpronym, type T WHERE m.qualifier =? And m.typeId is not zero and m.typeId = t.typeId Both of these are mapped in classes in NHibernate and models called model type. ICriteria.List should return the ModelType type list.
Thank you
There is good news and bad news is you can set criteria Which will return a list of ModelTypes. However, those sessions will not be managed. The reason for this is that, a separate query can return only one projection and estimates are always unmanaged.
The question below will generate the same query above because it does an internal insertion between the two entities and gives a different set based on those 2 columns. The result transformer should be set to generate some types, which can be set through properties. You can probably return the type of model type, but just know that they will not be managed by the session.
session. Create Character & lt; Model & gt; () .CreateAlias ("Type", "t") Add (Prohibitions ("Qualifier", Myqualifier). Administration (Projection. Districts Projection List) Add (Projection Alias (Projection Property ("TID"), "ID")) (Projections.Elease ("T. Type"), "Type-name"))). Setscult transformer (transformers. Aliastiban & lt; model type & gt; ())
Comments
Post a Comment