spring整合hibernate中遇到的坑

    xiaoxiao2021-04-02  48

    1.java.lang.NoClassDefFoundError: org/hibernate/util/DTDEntityResolver

    这个错误是hibernate版本在3.5以上的时候还集成了hibernate-annotations包,报出的错误。      解决方法:检查hibernate版本,如果在3.5以上去掉hibernate-annotations包 2.org/hibernate/HibernateException : Unsupported major.minor version 52.0 (unable to load class org.hibernate.HibernateException) 这个是hibernate版本和spring版本不匹配,请降低/升级hibernate版本 or 升级/降低spring版本

    3.@MappedSuperclass 注解

    把多个实体的公用部分提取出来,然后继承的时候 需要在父类上面加上@MappedSuperclass注解
    转载请注明原文地址: https://ju.6miu.com/read-665753.html

    最新回复(0)