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

时间:2013-07-18 16:01:15

标签: jpa eclipselink

我遇到以下错误:

The state field path 'rel.type' cannot be resolved to a valid type

在以下实体中编译命名查询时:

@NamedQueries({
@NamedQuery(name="findAll" , 
            query="SELECT rel " +
                    "FROM R01EDBEntityForStructureLabelsRelation rel " +
                   "WHERE rel.type = :type")
})
@Entity 
@Table(name = "R01ELABELRELATIONST00") @Cacheable(false)    
@Accessors(prefix="_")
@NoArgsConstructor
public class R01EDBEntityForStructureLabelsRelation {
    @Id @Column(name="SRC_LABEL_OID",length=50) @Basic
    @Getter @Setter private String _sourceLabelOid;

    @Column(name="TYPE",length=10) @Enumerated(EnumType.STRING)
    @Getter @Setter private R01MStructureLabelRelationType _type;
}

类型 R01MStructureLabelRelationType 是一个简单的枚举,如:

public enum R01MStructureLabelRelationType {
    SIMILAR
    ALIAS
}

任何想法?

0 个答案:

没有答案