NHibernate Entity Generator

Entity Developer for NHibernate offers advanced NHibernate entity generator functionality for generating NHibernate entity code. Entity Developer offers the following NHibernate entity generation features:

Output Configuration

Entity Developer for NHibernate allows you to specify the output folder (applied in the stand-alone Entity Developer application) or the output project and project folder (applied in the Visual Studio add-in).

With the File per class option you may generate either a separate file for each entity class or a single large file with the code for all the model classes. When generating a separate file per entity class, Entity Developer allows you to use Code-Behind feature - generate partial classes with a file for the generated class code and a file for user class code for each class.

Class Properties

Namespace and base class can be set for each entity class in its properties. You also may set the default namespace and base class for the model. They will be applied for all classes without the base class and namespace set explicitly.

Tweaking Generation Settings

Entity Developer provides a number of useful settings of its NHibernate entity generator to customize the generation of entity class code. It allows you to generate classes with or without Equals and GetHashCode implementation, IValidatable interface implementation, and support for IPropertyChanging and IPropertyChanged events. Equals and GetHashCode use class ID properties for comparison. The Validate method of the IValidatable interface triggers an OnValidate event that should perform the actual validation.

WCF Support

Entity Developer allows setting the Generate Data Contract Attribute property for entity classes and the Generate Data Member Attribute property for entity properties. These settings are available for all model entities and for each individual entity and entity property. When generating NHibernate entity code, the corresponding attributes will be added for entity classes and entity properties with these properties set.

Custom .NET Attribute Support

Entity Developer also provides support for attributes from available assemblies, which can be assigned to classes, properties or contexts of a model. Assigned attributes and the values of their parameters will be present in generated code. For example, the System.ComponentModel.DataAnnotation attributes can be used for validation.