NHibernate Query Generator with Fluent mappings - nhibernate

I was trying to find a good way to build dynamic queries with NHibernate and that lead me to NHibernate Query Generator which I like but we currently use Fluent NHibernate mappings and I wasn't sure if there was a way to use NHibernate Query Generator with Fluent NHibernate mappings. Any one have experience with this or know a better way to accomplish dynamic queries?

First, NHibernate already has ways to build dynamic queries (Criteria / QueryOver are specially useful for this). I googled "NHibernate Query Generator" and found a project that was abandoned more than 4 years ago.
Second, the method you use to create your mappings has nothing to do with the query APIs.

Related

How to write Queries for retreving, Checking Existence in NHIBERNATE USING(FLUENTNHIBERNATE)

How to write Queries for retreving, Checking Existence, and all we do in SQL
using NHIBERNATE (FLUENTNHIBERNATE)
Is FluentNhibernate is used in these Queries.
And
Which one is better Fluent Nhibernate Mapping or XML Mapping
Is there any relation or should i know LINQ for learning Nhibernate?
i can see several questions:
"How to write Queries for retreving, Checking Existence": see here for the different querylanguages in NH http://fabiomaulo.blogspot.com/2009/09/nhibernate-queries.html
"Is FluentNhibernate is used in these Queries": no FNH is used to configure NHibernate: alternative for hbm.xml and hibernate.cfg
"Which one is better Fluent Nhibernate Mapping or XML Mapping": in most cases FluentNHibernate is much easier to write than xml and covers 95% of options possible in xml. For beginners i would recommend FluentMappings because a lot of sensible defaults make it easier to get something to work.
"Is there any relation or should i know LINQ for learning Nhibernate?": LINQ is one of 6 ways to query in NHibernate. It is an elegant way but neither required nor the "works in all circumstances".

Is NHibernate LINQ stable and do all NHibernate bolt on projects allow it

I have been a long time user of Subsonic due to its ease of use and LINQ integration.
I now have to use something else because I need to be able to use Oracle.
I have 2 databases with the same schema therefore I want to have 1 set of POCO's and then change a connection string to switch between SQL & Oracle depending on the requirements.
Is this possible firstly, is LINQ fully functioning and stable in NHibernate and do Castle ActiveRecord and Fluent Hibernate allow the LINQ querying?
It is stable.
It is not fully functioning, and it is not planned to be fully functioning. I don't think there exists linq providers supporting 100% everything. The question should be: "Is it fully function for the queries you need to execute?" (The answer to that question would be yes in 99% of the cases)
You can find reported bugs/missing features in Jira
Fluent NHhibernate doesn't do any querying, just mapping. Castle active record doesn't query either. The linq namespace does not have a reference to active record or fluent and vise versa.
I wouldn't classify the NHibernate LINQ implementation as stable yet. The LINQ provider is still fairly young, so chance of hitting an unsupported query scneario still may be considerable in my opinion. However, other NHibernate query options are plentiful to workaround any issues the LINQ provider might throw up.

how to write fluent nhibernate queries?

I'm new to fluent nhibernate and generally nhibernate.
I searched a lot on the net but I couldn't find a good help.
I'm using fluent nhibernate and I mapped it with SQLServer 2008.
If there is a good help or book or sth else please tell me!
First of all I want to know how I can write native sql queries in my program? for example
DELETE * From SiteCategory
And generally I want to know how to write queries in fluent nhibernate? such as update,delete and select.
A good resource would be this series of screencasts:
Vacation Of Fluent NHibernate:
http://iamnotmyself.com/2009/10/26/vacation-of-fluent-nhibernate-introduction/
[link updated]
It was modeled after the very popular Summer of NHibernate series

Validating HQL against the domain with Castle Active Record

We use a lot of view model builders which pass HQL strings to the ActiveRecordMediator.Execute method to populate search objects for our views.
Doing refactoring occassionally breaks these 'magic' hql strings (without us knowing)
I was wondering if anyone has tried using nhibernate named queries to validate HQL in Castle Active Record?
Is there another way rather than writing integration tests (we use LINQ to Nhibernate for basic searchs but its not quite there yet for our complex queries)
Anyone have suggestions how to validate HQL against your domain?
ActiveRecord supports named queries through the HqlNamedQuery attribute, see this article. By defining queries this way you get NHibernate's named query validation.

nHibernate - Generate classes from a database?

I know that you can generate a database from classes and their mappings using nHibernate, but I can't find any good links to do this the other way around. We have a database that has already been designed, and we are looking at using nHibernate. It would be nice to use a tool to generate the mappings and classes from the database, and then we could tweak/manipulate them to suit our tastes.
NHibernate Mapping Generator
You can use nhibernate with an existing database. It is a matter of writing the mapping files.
I also recommend using Fluent Nhibernate...I started using this after this community recommended it..
Look at subsonic as well if you do not like maintenance of mappings.