title: Hibernate Exception: java.lang.IllegalArgumentException: Unknown name value [] for enum class
body: <p>I have mapped a column in Mysql DB to enum in java. But there are invalid entries in the table column (created manually) and which is not in the enum I created in java. When I try to load the entries I get the below exception. Is it possible to suppress this exception i.e. set the enum to 'null' when you have a invalid entry in the column in the Database?</p>
  
  <pre><code>java.lang.IllegalArgumentException: Unknown name value [] for enum class [model.enums.PeriodUnit]
  at org.hibernate.type.EnumType$NamedEnumValueMapper.fromName(EnumType.java:467)
  at org.hibernate.type.EnumType$NamedEnumValueMapper.getValue(EnumType.java:452)
  at org.hibernate.type.EnumType.nullSafeGet(EnumType.java:107)
  at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:127)
  at org.hibernate.type.AbstractType.hydrate(AbstractType.java:106)
  at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2912)
  at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1673)
  at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1605)
  at org.hibernate.loader.Loader.getRow(Loader.java:1505)
  at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:713)
  at org.hibernate.loader.Loader.processResultSet(Loader.java:943)
  at org.hibernate.loader.Loader.doQuery(Loader.java:911)
  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:342)
  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:312)
  at org.hibernate.loader.Loader.loadCollection(Loader.java:2238)
  at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:65)
  at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:674)
  at org.hibernate.event.internal.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:85)
  at org.hibernate.internal.SessionImpl.initializeCollection(SessionImpl.java:1849)
  at org.hibernate.collection.internal.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:681)
  at org.hibernate.engine.internal.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:1030)
  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:347)
  at org.hibernate.loader.Loader.doList(Loader.java:2526)
  at org.hibernate.loader.Loader.doList(Loader.java:2512)
  at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2342)
  at org.hibernate.loader.Loader.list(Loader.java:2337)
  at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:495)
  at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:357)
  at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
  at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1269)
  at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
  </code></pre>