实体类
public class Event {
@Id
private String name;
private String description;
private Date eventDateTime;
//getter and setter code
}
服务等级
EventService {
@Autowired EventRepository eventRepository;
List<Event> getEvents () {
List<Event> events = eventRepository.findAll();
return events;
}
}
对于样本数据集:Event ('add', '', '2018-01-01 00:00:10') Event ('add', '', '2018-01-01 00:10:10') Event ('delete', '', '2018-01-01 00:20:00') 事件 ('edit', '', '2018-01-01 00:30:00')
JPA findAll() 查询返回重复的行:
事件 ('add', '', '2018-01-01 00:00:10') 事件 ('add', '', '2018-01-01 00:00:10') 事件 ('add', '', '2018-01-01 00:00:10') 事件 ('add', '', '2018-01-01 00:00:10')
波斯汪
皈依舞
相关分类