<p>Is there a way to persist an enum to the DB using NHibernate? That is have a table of both the code and the name of each value in the enum.</p>

<p>I want to keep the enum without an entity, but still have a foreign key (the int representation of the enum) from all other referencing entities to the enum's table.</p>

An easy but not so beautiful solution:
Create an integer field with and set the mapping in the mapping file to the field. 
Create a public property that uses the integer field.
```
```
private int myField;
public virtual MyEnum MyProperty
{
   get { return (MyEnum)myField; }
   set { myField = value; }
}
```
```