:-)
Absolutely awesome.
Now, just one question... Let's say I want to override
StartsWith/EndsWith/Contains instead of adding a new method...
Do I have to implement a full ILinqToHqlGeneratorsRegistry, copying
everything from DefaultLinqToHqlGeneratorsRegistry? or is there a (planned?)
way to unregister/override a specific generator?
Diego
On Thu, Jul 29, 2010 at 10:25, Fabio Maulo <[email protected]> wrote:
> Example of usage for your RDBMS limitations (for example when your RDBMS
> does not support parameters concatenation in the LIKE clause).
>
>
> http://fabiomaulo.blogspot.com/2010/07/nhibernate-linq-provider-extension.html
>
>
> On Wed, Jul 28, 2010 at 6:12 PM, Fabio Maulo <[email protected]> wrote:
>
>> Now you have a way to inject the translators of your own LINQ extensions
>> or a way to switch from default implementations, for some known
>> methods/properties, to your own implementations.
>>
>> You can configure the LinqToHqlGeneratorsRegistry through XML
>> <property
>> name="linqtohql.generatorsregistry">YourLinqToHqlGeneratorsRegistry assembly
>> qualified name</property>
>>
>> You can use your implementation per Dialect through the constructor of
>> your custom dialect
>> DefaultProperties[Environment.LinqToHqlGeneratorsRegistry] =
>> "YourLinqToHqlGeneratorsRegistry assembly qualified name";
>>
>> You can configure the LinqToHqlGeneratorsRegistry by code with
>> configuration.Properties.Add(Environment.LinqToHqlGeneratorsRegistry,
>> typeof(YourLinqToHqlGeneratorsRegistry).AssemblyQualifiedName)
>> or
>> configuration.SetProperty(Environment.LinqToHqlGeneratorsRegistry,
>> typeof(YourLinqToHqlGeneratorsRegistry).AssemblyQualifiedName);
>> or
>> configure.LinqToHqlGeneratorsRegistry<YourLinqToHqlGeneratorsRegistry>();
>>
>>
>> And, as usual, if you want, YourLinqToHqlGeneratorsRegistry can be
>> injected with whatever you want if you have a custom implementation
>> of IObjectsFactory inside your own BytecodeProvider.
>>
>> Welcome to the world of options, *Welcome to NHibernate!!*
>>
>> --
>> Fabio Maulo
>>
>>
>
>
> --
> Fabio Maulo
>
>