ummmm yes of course , but if he already has tables names and columns wouldn’t 
he be better off using CreateSQLQuery rather than transforming these into 
classes and props and using HQL?

From: [email protected] [mailto:[email protected]] On Behalf Of 
Ricardo Peres
Sent: 20 May 2015 11:12
To: [email protected]
Subject: Re: [nhusers] Get Meta Data from Database table name and column

Richard:
CreateQuery uses HQL whereas CreateSQLQuery uses SQL.

Felipe:
You want to know to which tables and columns the entities and their properties 
map to, right? I once wrote a post on this, you can find it here: 
https://weblogs.asp.net/ricardoperes/nhibernate-metadata.

RP


On Wednesday, May 20, 2015 at 7:25:38 AM UTC+1, Rippo wrote:
Quick question what is difference between?

CreateQuery and CreateSQLQuery

Many Thanks
Richard

From: [email protected]<javascript:> 
[mailto:[email protected]<javascript:>] On Behalf Of Felipe Oriani
Sent: 19 May 2015 23:31
To: [email protected]<javascript:>
Subject: Re: [nhusers] Get Meta Data from Database table name and column

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]<javascript:>> 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]<javascript:>> 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]<javascript:>
--
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]<javascript:>.
To post to this group, send email to [email protected]<javascript:>.
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]<javascript:>.
To post to this group, send email to [email protected]<javascript:>.
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]<javascript:>
--
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]<javascript:>.
To post to this group, send email to [email protected]<javascript:>.
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]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[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.

Reply via email to