你必须添加 @Embeddable 你的注释 CatPathKey 类:
@Embeddable
CatPathKey
@Embeddable public class CatPathKey { public Long parentC; public Long childC; }