mixing joined and single table inheritance and querying for all objects

后端 未结 1 1743
说谎
说谎 2021-01-16 03:52

I have a webapp that is working with the following configuration (I changed the entity names):

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table         


        
相关标签:
1条回答
  • 2021-01-16 04:15

    Did you try hibernateTemplate.find("from Mammal") ?

    Your find query needs to be in terms of JPA entities not table names.

    BTW tables are typically named in the singular - it generally makes complex queries read a bit better - e.g. WHERE chicken.id = egg.id

    0 讨论(0)
提交回复
热议问题