I have the following property
<property name="Allocated" type="decimal" formula="(select sum(a.AllocationAmount) from Allocation a where a.TransactionId = TransactionId)" />
This loads the transaction amount that has been allocated for invoices that work beautifully.
However, in most cases, I do not need this amount. Is there a way to conditionally load this computed column? Or is there a way to add this computed column to HQL / Critera so that I can just make it part of some specific queries that I ran?
NH 3.0 , , (. http://ayende.com/Blog/archive/2010/01/27/nhibernate-new-feature-lazy-properties.aspx)
, , , .
access="none" , , , hql. . .
access="none"
, , , / , api ( Projections.SqlFunction)
Projections.SqlFunction
Source: https://habr.com/ru/post/1756103/More articles:Is it possible to increment an identifier in a foreach loop without evaluating its expression? - c #How can I pay for the application - currencyType of database field for storing web pages - databaseCan Netbean edit deleted files - fileExport function from dll - use def file or dllexport? - visual-c ++https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1756104/what-happens-to-an-expired-uiimage-imagenamed-object&usg=ALkJrhiV-ufj-Fv3GnHNuzusuMGXL2IS6Qневозможно записать в файл с помощью печати - perlProblems reassigning re-creation of code with GET parameters - redirectTips for creating your own wiki? - wikiwhere to store constants in iphone application? - objective-cAll Articles