views:

1998

answers:

7

I'm looking for an editor that has the help from

http://www.hibernate.org/hib_docs/nhibernate/html/mapping.html

built in, and allows simple editing of the XML files in a GUI fashion. I realise there's CodeSmith and MyGeneration, but from what I remember these only go one way, and don't allow editing existing HBM files.

+5  A: 

I don't believe there is an editor for Hibernate/NHibernate mapping files that has context-sensitive help. If you are a .NET developer (using NHibernate and Visual Studio .NET) you can edit the mappings with IntelliSense by registering a schema document: see Using NHibernate with Visual Studio .NET for instructions.

Another option to consider is using the NHibernate's Fluent API. This replaces mapping files with strongly-typed C# code.

JulianM
+1 for Fluent Nhibernate
Sebastian Sedlak
+2  A: 

There is another option with Visual Studio. If you have Resharper you can download the plug-in for NHibernate mapping files. This solution has worked out perfectly for me. You can read more about the plug in here: http://nhplugin.lieser-online.de/. Hope this works for you.

Pedro Santos
This one doesn't work with Resharper 4.5
fordan
+5  A: 
Codebrain
This looks the most promising, except it gets an exception when loading "Could not load file or assembly 'System.Data.SQLite, Version=1.0.35.1, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format"
Chris S
Codebrain
I downloaded + recompiled and go it working. I think this is probably the closest to the answer I'll get so I'll give you the tick :)
Chris S
thanking you sir!
Codebrain
+1  A: 

Why not use ActiveWriter to generate the mappings? You can always edit them afterwards. AW generates the model / mapping for both NHibernate and ActiveRecord. The editor runs WITHIN Visual Studio.NET and you can do drag-drop via server explorer.

Hadi Eskandari
+1  A: 

The best option I've come across is is IDEA's Hibernate/JPA editor. IDEA is not free, however.

Tim
+1  A: 

Have you tried Hibernate's own Eclipse plug-in named Hibernate Tools for Eclipse and Ant?

http://www.hibernate.org/255.html

Even if you dont have expirience with Eclipse and its add-ons it should be fairly straightforward to install and use their addon:

Just download it, unzip it into the eclipse directory, and fire up the IDE. What you need to do next is to open up the Hibernate perspective.

Azder
A: 

I'm using VisualStudio and the schema (nhibernate-mapping.xsd) to activate the intellisense. The plug-in for R# is useful to check the mapping with the class.