【发布时间】:2018-07-30 14:39:14
【问题描述】:
假设我们有以下模型,
基类
class Meeting
{
String title;
}
第一个派生类
class OfficialMeeting extends Meeting
{
int numberOfParticipants;
String meetingRoomName;
}
第二个派生类
class Party extends Meeting
{
String theme;
}
作曲
class Schedule
{
List<Meeting> meetings;
}
当我尝试搜索主题为“海滩派对”的集合“时间表”时,Spring 数据 mongo 错误提示会议没有名为主题的字段。
请在模型设计或搜索 mongo 集合方面提出解决方案。
【问题讨论】:
标签: spring mongodb spring-boot inheritance spring-data-mongodb