Could anyone please describe how to use NHibernate Query Analyzer? I downloaded it and trying to build it but it fails, I am not quite sure how to use it.
I am using nHibernate with Sybase and WCF.
Any help is greatly appreciated.
Thanks
After downloading the tool, run Ayende.NHibernateQueryAnalyzer.exe and then:
File -> New -> Project
Click 'Add File(s)...' button and add the following files:
(note: in older versions of NHQA, it was necessary to copy the DLLs including its dependencies to the same directory as the NHibernateQueryAnalyzer.exe but that is no longer the case)
Click 'Build Project' button
If receive errors, then something needs to be fixed in either the configuration file, the mapping file(s), the classes in the DLL(s), or all of them. It is important to note the exception messages to help troubleshoot and identify which of the above is source of the problem.
After successfully building the NHQA project, you can create queries:
File -> New -> Query
Now, type in HQL statements. Entities' names and properties can be dragged and dropped from the tree view on the left to your HQL statements on the right. As you type, it provides on-the-fly checking and validation of your HQL statements in the 'Exceptions' tab and displays the auto generated SQL statements in the 'SQL' tab. A sidebar GUI is also available for dynamically defining named parameters.
Hit F5 to execute the query. If it executes successfully, you can view the results in tabular form in the 'DataBase Results' tab or as objects in the 'Object Graph' tab.
New Mapping files can be created by:
New -> Mapping (hbm.xml)
or existing ones can be edited directly:
Open -> Open Mapping...
Same for Configuration files:
New -> Configuration (cfg.xml)
Open -> Open Configuration...
Documentation on setup and usage tutorial for NHibernate Query Analyzer is quite sparse but hopefully the above helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With