sim51/logisima-play-yml — Issue #5: ClassCastException : MapEntryProxy to JPABase
Author: Fluor
Created: 2012-01-28 07:41:31+00:00
State: open

Hi,

I've tried to use your module, but got the following exception :
23:35:24,845 INFO ~ Generate YML for class id :Staff_1(24fields)
Exception in thread "main" java.lang.ClassCastException: org.hibernate.collection.PersistentMap$MapEntryProxy cannot be cast to play.db.jpa.JPABase
at play.modules.yml.YmlExtractorUtil.getObjectId(YmlExtractorUtil.java:356)
at play.modules.yml.YmlExtractorUtil.object2YmlObject(YmlExtractorUtil.java:208)
at play.modules.yml.YmlExtractor.mainWork(YmlExtractor.java:87)
at play.modules.yml.YmlExtractor.main(YmlExtractor.java:71)

My incriminated Staff entity has the following attribute, which might be the root of this bug :
@OneToMany(mappedBy = "member", cascade = CascadeType.ALL)
@MapKey(name="provider")
public Map accounts = new EnumMap(ProviderType.class);

ProviderType is in fact an Enum, so it doesn't extend JPABase.