[hibernate-dev] Enum mapping in hbm.xml

Emmanuel Bernard emmanuel at hibernate.org
Mon Jul 20 03:25:03 EDT 2015


> On 19 Jul 2015, at 16:53, Steve Ebersole <steve at hibernate.org> wrote:
> 
> What I propose is that we change this.  I am kind of torn as to the default
> tbh.  I think JPA's default of ORDINAL is the wrong choice.  I think NAMED
> is the better choice.  Well technically I think an independent mapping code
> it best.  But strictly between ORDINAL/NAMED, I think NAMED is better.  So
> if everyone agrees that we change this to definitively determine the enum
> mapping up front, which style do we choose as the default.  Obviously the
> big argument for choosing ORDINAL is consistency with annotations.

Even if like you I prefer NAMED over ORDINAL, I would prefer consistency with annotations. If you feel strongly on the subject, I think the other way is fine too since:

* the recommendation is to be explicit
* hbm is already quite a different beast than annotations/orm.xml



More information about the hibernate-dev mailing list