Spring 3.1 Hibernate 4 exception for Inheritance [cannot be cast to org.hibernate.mapping.RootClass]

前端 未结 4 790
一生所求
一生所求 2020-11-29 09:42

Hi I have just started using Spring , with Hibernate4 and maven. Basically my class hierarchy is HUmanMicroTask extends from MicroTask . In future there may be several other

4条回答
  •  攒了一身酷
    2020-11-29 10:28

    to fix this Remove @Id from Subclass

    in MicroTask keep

       @Id
        @GeneratedValue(generator = "system-uuid")
        @GenericGenerator(name = "system-uuid", strategy = "uuid")
        @Column(name = "MICROTASKID")
        private String microTaskId;
    

    in Subclass HumanMicroTask remove

       @Id
        @Column(name = "HMTID")
        private String humanMicroTaskid;
    

提交回复
热议问题