示例:
@OneToMany(fetch=FetchType.LAZY, mappedBy="album", cascade=CascadeType.ALL)
private List<Photo> listPhoto;
List<Album> albums = (List<Album>) criteria.list();
for(Album album : albums) {
Hibernate.initialize(album.getListPhoto().get(0));
}
当我这样做时,给我带来List中的所有Object,我只需要First Object,即使是.get(0)