You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finder.byId should return the entity on a cache hit for entities where the @Id field is an Enum (mapped using @DbEnumValue/@EnumValue).
Actual behavior
java.lang.NumberFormatException: For input string: "Approved"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:652)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at io.ebeaninternal.server.type.EnumToDbIntegerMap.getBeanValue(EnumToDbIntegerMap.java:40)
at io.ebeaninternal.server.type.ScalarTypeEnumWithMapping.toBeanType(ScalarTypeEnumWithMapping.java:86)
at io.ebeaninternal.server.deploy.id.IdBinderSimple.convertId(IdBinderSimple.java:236)
at io.ebeaninternal.server.deploy.BeanDescriptor.convertId(BeanDescriptor.java:2150)
at io.ebeaninternal.server.deploy.BeanDescriptorCacheHelp.loadBeanDirect(BeanDescriptorCacheHelp.java:630)
at io.ebeaninternal.server.deploy.BeanDescriptorCacheHelp.loadBean(BeanDescriptorCacheHelp.java:613)
at io.ebeaninternal.server.deploy.BeanDescriptorCacheHelp.convertToBean(BeanDescriptorCacheHelp.java:604)
at io.ebeaninternal.server.deploy.BeanDescriptorCacheHelp.beanCacheGetInternal(BeanDescriptorCacheHelp.java:587)
at io.ebeaninternal.server.deploy.BeanDescriptorCacheHelp.beanCacheGet(BeanDescriptorCacheHelp.java:566)
at io.ebeaninternal.server.deploy.BeanDescriptor.cacheBeanGet(BeanDescriptor.java:1295)
at io.ebeaninternal.server.core.DefaultServer.findIdCheckPersistenceContextAndCache(DefaultServer.java:1014)
at io.ebeaninternal.server.core.DefaultServer.findId(DefaultServer.java:1041)
at io.ebeaninternal.server.core.DefaultServer.find(DefaultServer.java:945)
at io.ebeaninternal.server.core.DefaultServer.find(DefaultServer.java:935)
at io.ebean.Finder.byId(Finder.java:159)
ProductStatusproductStatus = ProductStatus.find.byId(ProductStatus.Status.Approved);
// the second call failsproductStatus = ProductStatus.find.byId(ProductStatus.Status.Approved);
The text was updated successfully, but these errors were encountered:
Expected behavior
Finder.byId
should return the entity on a cache hit for entities where the@Id
field is an Enum (mapped using@DbEnumValue/@EnumValue
).Actual behavior
Steps to reproduce
Updated
base-example
code at https://github.com/martinoneutrino/examples. This uses release 13.11.0, but error encountered in at least 13.18.0.Basically:
In the
Cached
entity class:Call the entity with:
The text was updated successfully, but these errors were encountered: