Java EntityNotFoundException(无法计算)

Java EntityNotFoundException(无法计算),java,spring,hibernate,Java,Spring,Hibernate,我将模型映射如下: @Entity public class Notification { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name="ad") @Where(clause="is_deleted <> '1'") @JsonIgnore public Ad getAd() { return ad;

我将模型映射如下:

    @Entity
    public class Notification {

        @ManyToOne(fetch = FetchType.LAZY)
        @JoinColumn(name="ad")
        @Where(clause="is_deleted <> '1'")
        @JsonIgnore
        public Ad getAd() {
            return ad;
        }

    }

由于您的表中没有试图检索的任何数据,因此导致此异常

首先在表中插入记录,然后尝试获取数据,不会出现任何异常

多谢各位
Chandan

请添加一个完整的堆栈跟踪,使用
code
添加它。另外,请添加您的Hibernate配置和Hibernate版本。您是否也使用Hibernate映射了
Ad
?显示映射为hibernate的thst classAd的代码。但这是一个方向映射的许多。
Method threw 'javax.persistence.EntityNotFoundException' exception.
Cannot evaluate Ad_$$_javassist_1.toString()