findeByExample()方法

MyEclipse自动生成的SpringDAO中, findeByExample()方法中传入的实例不应有与外键有关的属性。若有,不会报错,但会将其忽略。



Ticket ticket = new Ticket();
ticket.setTicketPlay(playId);
ticket.setTicketRoom(roomId);
ticket.setPlay(play);
若Play的主键是Ticket的外键
则执行
ticketDAO.findByExample(ticket);

ticket.setPlay(play);
这句将被忽略

你可能感兴趣的:(java,MyEclipse)