Yes, I know it does not sounds good but I'll try explain.

My customer will develop some reports using the Telerik Report and the
customer does not have knowledge of the model mapped with nhibernate, only
the database. So, we are using some internal configurations of the telerik
reports to create a dynamic filter on the page and one of these parameter
are DropDownLists. The customer will configure the dropdownlists with
database information like table, key/value columns. We could use SQL
language to hit on database, but I would like to pass this responsability
to NHibernate, using HQL. I am not sure if it is the best solution, but I
think it works.

I don't know how to get these information from NHibernate. Can you help me?




On Tue, May 19, 2015 at 6:21 PM, Gunnar Liljas <[email protected]>
wrote:

> But why use the table name and column name as parameters? Wouldn't the
> entity name and property name be better? Or even better, a property lambda.
>
> —
> Sent from Mailbox <https://www.dropbox.com/mailbox>
>
>
> On Tue, May 19, 2015 at 8:00 PM, Felipe Oriani <[email protected]>
> wrote:
>
>> Hi all,
>>
>> I have a method which receives tree parameters that holds a table name
>> and two columns. I would like to hit an HQL command using this information
>> to create an list as a result. I know how to deal with HQL but I would like
>> to know, how can I get the entity name and properties from these
>> parameters, for sample:
>>
>> public IEnumerable<DropDownListDto> GetDropDownList(string tableName,
>> string columnValue, string columnText)
>> {
>>     string entityName = ???;
>>     string propertyValue =  ???;
>>     string propertyText = ???;
>>
>>     // I have the sessionFactory instance and session here.
>>
>>    // execute hql and return results
>> }
>>
>> Is there any way to do it?
>>
>> I have this parameters because it will be developed by a customer and not
>> by the developer team.
>>
>> Thank you
>>
>>
>> --
>> ______________________________________
>> Felipe B Oriani
>> [email protected]
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "nhusers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/nhusers.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/nhusers.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
______________________________________
Felipe B Oriani
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to