代码之家  ›  专栏  ›  技术社区  ›  SouthBeach

对象框到任意列表

  •  0
  • SouthBeach  · 技术社区  · 7 年前

    我有两个实体与一对多关系相连,我想得到整个元素列表。
    我试过:

    int count = showcase.notices.size();
    List<Notice> notList = showcase.notices.subList(0, count);
    

    这个 sublist 定义为 sublist(int start, int end) 其中 end 不在列表中。
    有没有更直接的方法来获取整个列表?
    有点像

    List<Notice> notList = showcase.notices.getList();
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   Markus Junginger    7 年前

    你的 showcase.notices 已是列表。