Wildfly MongoDB Hibernate OGM - ElementCollection hibernate.MappingException:无法确定类型:java.util.List

时间:2016-11-25 10:30:17

标签: mongodb scala jpa wildfly-10 hibernate-ogm

我正在尝试在Wildfly 10(10.1.0)上为Mongodb(3.2.10)运行hibernate-ogm(5.0.3.Final)。我有一个名为User的实体映射到mongodb中的集合用户并包含权限列表。当我尝试部署时,我得到以下异常

  

引起:org.hibernate.MappingException:无法确定类型   for:java.util.List,at table:users,for columns:   [org.hibernate.mapping.Column(permissions)] at   org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:396)at at   org.hibernate.tuple.PropertyFactory.buildEntityBasedAttribute(PropertyFactory.java:157)     在   org.hibernate.tuple.entity.EntityMetamodel。(EntityMetamodel.java:208)     在   org.hibernate.persister.entity.AbstractEntityPersister。(AbstractEntityPersister.java:509)     在   org.hibernate.ogm.persister.impl.OgmEntityPersister。(OgmEntityPersister.java:199)     在   org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister。(SingleTableOgmEntityPersister.java:34)     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native   方法)at   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     在   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)     在   org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96)     在   org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77)     在   org.hibernate.internal.SessionFactoryImpl。(SessionFactoryImpl.java:346)     在   org.hibernate.ogm.boot.impl.OgmSessionFactoryBuilderImpl.build(OgmSessionFactoryBuilderImpl.java:54)     在   org.hibernate.ogm.boot.impl.OgmSessionFactoryBuilderImpl.build(OgmSessionFactoryBuilderImpl.java:23)     在   org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879)     ......还有12个

实体用户如下:

@Entity(name = "users")
class User extends TableGeneratedId {
  @NotNull
  @BeanProperty var username: String = _

  @NotNull
  @BeanProperty var password: String = _

  @ElementCollection
  @BeanProperty var permissions: util.List[String] = _
}

我正在使用Scala 2.12.0。

不确定我是否遗漏了任何罐子或东西?如果删除列表,实体持久性和合并工作正常。

我遵循了https://docs.jboss.org/hibernate/stable/ogm/reference/en-US/html_single/?v=5.0#ogm-mongodb的Wildfly参考文档中提到的所有要点,但没有运气。任何帮助将不胜感激。

0 个答案:

没有答案