我有一个抽象的Scala类作为Mongo集合。使用吗啡在mongo集合中找不到字段
@Entity("aclTemplate")
abstract class AclTemplate(@([email protected]) var id: String) extends Serializable
另一类扩展上述
@Entity("aclTemplate")
class GroupACLTemplate(id: String, var groupRoleAccess: Set[GroupRoleAccess]) extends AclTemplate(id) with Serializable
有集合中的GroupACLTemplate
一些文档。我想一个简单的查询
createQuery().disableValidation().field("groupRoleAccess.groupId").equal(groupId).asList();
这将引发ValidationException
org.mongodb.morphia.query.ValidationException: The field 'groupRoleAccess.groupId' could not be found in 'com.model.acl.AclTemplate'
我不认为这是因为在吗啡的长期多态性问题。因为当我试图访问只是groupRoleAccess
,它是能够。但是,它无法访问该集合。这是一个普通的Java集。这是GroupRoleAccess
类
class GroupRoleAccess(var groupId: String, var roleId: String) extends Serializable
我在这里错过了什么吗?
没有,没有工作 – rockydgeekgod