Jpa 命名查询中的枚举出错-无法将字段解析为有效类型

Jpa 命名查询中的枚举出错-无法将字段解析为有效类型,jpa,eclipselink,Jpa,Eclipselink,我发现以下错误: The state field path 'rel.type' cannot be resolved to a valid type 在以下实体内编译命名查询时: @namedquerys({ @NamedQuery(name=“findAll”, query=“选择rel”+ “来自R01EdBentityForStructureLabelsRel”+ “其中rel.type=:type”) }) @实体 @表(name=“R01ELABELRELATIONST00”)@C

我发现以下错误:

The state field path 'rel.type' cannot be resolved to a valid type
在以下实体内编译命名查询时:

@namedquerys({
@NamedQuery(name=“findAll”,
query=“选择rel”+
“来自R01EdBentityForStructureLabelsRel”+
“其中rel.type=:type”)
})
@实体
@表(name=“R01ELABELRELATIONST00”)@Cacheable(false)
@访问器(前缀=“”)
@诺尔格构装师
结构标签关系的公共类R01EdBentity{
@Id@Column(name=“SRC\u LABEL\u OID”,长度=50)@Basic
@Getter@Setter私有字符串\u sourceLabelOid;
@枚举列(name=“TYPE”,length=10)(EnumType.STRING)
@Getter@Setter私有R01MSStructureLabelRelationType\u类型;
}
R01MSStructureLabelRelationType类型是一个简单的枚举,如:

公共枚举R01MSStructureLabelRelationType{
相似的
别名
}

有什么想法吗?

你给你的字段命名为
\u type
,而不是
type
。太简单了!我不敢相信我以前从未见过它!。。。我以前也有过同样的错误,这与我自己用下划线命名私有字段的习惯有关(是的,不建议这样做)。非常感谢你。。。