Refactoring NHibernate Mappings

I'm curious if anyone at JetBrains has considered adding refactoring support for NHibernate mapping files at some point in the future (say in the 3.0 or later release). We've been creating a ton of these mapping files for a legacy database using MyGeneration, but refactoring the mapping files has been somewhat of a challenge. Refactoring the classes has been relatively easy with ReSharper's Rename functionality, but we sometimes forget to rename the property names in the .hbm.xml files. We have a unit test that instantiates the ISessionManager specifically to verify the "correctness" of our mappings to classes, but I suspect it would be less stressful if ReSharper could reach into the .hbm.xml mapping file, find Name="foo", and change it to Name="bar" for us.

I'm just dreaming and wishing... but I also realize there are lot of other ORM tools available that do things differently, so maybe I'm opening a can of worms here.

3 comments
Comment actions Permalink

Lothan schrieb:


but I also realize there are lot of other ORM tools available that do things differently, so maybe I'm opening a can of worms here.


Yes, i think this is to special. But it's the perfect place for an
OpenAPI extension. I know one man who is working exactly on the
NHibernate Mapping for R#. But i don't know the status or plans for the
future. But i'm sure he's reading this here:)


--
Freundliche Grüße

Albert Weinert

http://der-albert.com

0
Comment actions Permalink


Albert Weinert schrieb:

But i'm sure he's reading this here:)


Yes!

I started a plugin for NHibernate mapping files. I used the builtin
scanner from MSBuild/NAnt support. So far the plugin parses the .hbm.xml
files and they are recognized by ReSharper. Next phase would be to
listen to the "rename event".

But my plugin was last compiled while R# 2.0 was in early EAP (maybe
around build 240 or so). I just opened the solution and found that some
of the R# interfaces changed. So it is some work to fix it... and a lot
more work to support renames...

BUT this isn't possible without some examples from JetBrains. Please
please give us some plugin examples!


Sincerely,
Stefan Lieser
http://www.lieser-online.de

0
Comment actions Permalink

This is great news!
I was thinking just about the same tomorrow :)
I would like to participate on this....

Michal

Stefan Lieser wrote:


Albert Weinert schrieb:

>> But i'm sure he's reading this here:)


Yes!

I started a plugin for NHibernate mapping files. I used the builtin
scanner from MSBuild/NAnt support. So far the plugin parses the .hbm.xml
files and they are recognized by ReSharper. Next phase would be to
listen to the "rename event".

But my plugin was last compiled while R# 2.0 was in early EAP (maybe
around build 240 or so). I just opened the solution and found that some
of the R# interfaces changed. So it is some work to fix it... and a lot
more work to support renames...

BUT this isn't possible without some examples from JetBrains. Please
please give us some plugin examples!


Sincerely,
Stefan Lieser
http://www.lieser-online.de

0

Please sign in to leave a comment.