After upgrading from Fluent NHibernate 1.0 RTM to 1.1 I got some strange errors when creating the database. After some investigation I discovered that FNH 1.0 quoted all field names in the generated mapping files like 'user', but FNH 1.1 did not. This results in errors for the generated sql script when I use restriced keywords for properties.
Is it somehow possible to reactivate this feature of FNH 1.0 or enable quoting otherwise?
Are you talking about the code that is generated and sent to the sql server or the psedo mappings files it generates?
Related
I have unknown data which I get it straight from query/datatable How do I use WebApiContrib.Formatting.Xlsx library? which it asks me to have a model for every xlsx reports. I have tried to generate dynamic class from datatable but it doesnt seem working.
This will be possible with the 2.0 release, which supports custom column resolvers and more robust serialisation for ExpandoObject. You can grab the prerelease version now on NuGet, and I plan to document the new functionality over the nice big break I have coming up soon.
I have been analysing the WordNet 3.0 MySql database files, that I downloaded from:
http://www.princeton.edu/wordnet/download/current-version/
And have notices that there are only 4962 morphmaps present. This means, that if I search for the term "Carrying" I get zero results.
If I search for "Carrying" however, on the WordNet 3.1 search page: http://wordnetweb.princeton.edu/perl/webwn
I get directed to "Carry" - which is an expected result.
I assume that Wordnet 3.1 has more rows in its morphmaps table, and that is why "Carrying" yields the correct result.
Does anyone know:
1) Does WordNet 3.1 have more morphmaps than 3.0?
2) Where I might source the 3.1 mysql database files for Wordnet 3.1
3) Are there other ways of getting more morphmaps into Wordnet?
Thanks for your kind assistance
You don't use morphmaps to convert a word into its base form. You use lemmatizer.
You can check out this link to see many lemmatizers available.
The Web version of WordNet already incorporates some software, it's not just plain search on the database. And even so, after lemmatization it's searching on the sense database (say, index.sense), not morphmaps database.
Simple question for I bet a not so simple answer.
Think of a project like Wordpress. The base of Wordpress is great and the developers built it to be extended with widgets or plugins etc.
Now think NHibernate, specifically with Fluent Mappings.
Put them together and you have a great and stable "base" system BUT how do you load mappings presented from external assemblies? I realize that the system would have to load the Assemblies on the fly using reflection but how do you configure nHibernate, Fluently, at first run to realize that there are extra entities to be loaded from those assemblies? How do you reference them?
I know you can;t add Mappings at run-time after the configurations is made, well you have to recreate the SessionFactory. This is why I want to load all required entities at runtime.
I also know that this can be somewhat accomplished with Dependancy Injection but I do not wish to go that route nor want the extreme baggage that comes with it.
If the plain old nHiberante config file can be modified and then referenced at runtime to reflect new Entities I can only assume there has to be a way to do it Fluently.
Also, based on answers: do you make the configuration from the base project or a DATA ACCESS assembly?
Thanks for your help.
You can pass an NHibernate Configuration object to Fluently.Configure(). That way you can update the configuration. You need to re-create the session factory when you do that, like you said.
You can scan the assemblies in the bin folder for assemblies that contain fluent mapping classes (Assembly.Load, then check
Assembly.GetExportedTypes()
.Any(x => x.IsClass
&& !x.IsAbstract
&& typeof(IMappingProvider).IsAssignabledFrom(type))
or similar) and add the assembly. When all assemblies are scanned, (re-)create the session factory.
I'm doing something similar in an extensible application framework I have written (although I've moved to from Fluent NHibernate to NHibernate mapping by code, but the principles are similar).
I've downloaded the fluent hibernate 1.2 zip file from the website.
It contains various files, amongst them
NHibernate.dll
FluentNHibernate.dll
Castle.Core.dll
Remotion.Data.Linq.dll
Antlr3.Runtime.dll
Iesi.Collections.dll
NHibernate.ByteCode.Castle.dll
Q1) Are all these files required for doing a simple application?. By simple I mean that the db contains a few tables that doesn't need complicated queries and has limited levels/amounts of reference keys and joins.
Q2) Does fluent nHibernate run on mono on linux?
no; see here for what's needed and what's optional.
it runs wherever you can run (and develop) .net programs (i.e it, obviouslly, needs .net runtime environment).
Is there any way for me to generate an nHibernate configuration file from a Configuration instance (that has been already configured by some external code?). I'm looking for an easy way to mimic this external code with a static XML file?
(I guess similar to the "ExportTo" method that Fluent nHibernate has for fluent mappings - but acting on the resulting Configuration object instead).
Thank you!
No, there is no way to do that easily.
What can be done (and is common) is binary serialization of the configuration. Check http://github.com/ayende/Effectus/blob/master/Effectus/Infrastructure/BootStrapper.cs