Chris S
Chris S

Reputation: 65426

Hibernate/NHibernate mapping file editor

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.

Upvotes: 5

Views: 4171

Answers (7)

Fabio Maulo
Fabio Maulo

Reputation:

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.

Upvotes: 0

Azder
Azder

Reputation: 4728

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.

Upvotes: 1

Tim
Tim

Reputation: 6961

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

Upvotes: 1

Hadi Eskandari
Hadi Eskandari

Reputation: 26354

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.

Upvotes: 1

Codebrain
Codebrain

Reputation: 5593

Probably worth taking a look at the NHibernate Query Analyzer by Oren Eini. Primarily used to analyze HQL queries it also has a fairly useful HBM editor:

NHibernate Query Analyzer Screenshot http://img6.imageshack.us/img6/5617/nhqa.gif

Old Project Page (with flash demo): http://ayende.com/projects/nhibernate-query-analyzer.aspx

New Project Page: http://www.assembla.com/wiki/show/NHibernateQueryAnalyzer

This will allow editing for HBM files and will show all of the available attributes for each mapping node.

Given that you can download the source code it wouldn't be that trivial to add the inline help.

Upvotes: 6

Pedro Santos
Pedro Santos

Reputation: 1004

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.

Upvotes: 2

JulianM
JulianM

Reputation: 1072

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.

Upvotes: 6

Related Questions