public static void detachTM(Page<ProposalModel> result) { if (result == null || result.getContent() == null) { return; } for (ProposalModel t : result) { Hibernate.initialize(t); Hibernate.initialize(t.getVotes()); } }
@Override protected ProposalListItem transferDbToViewModel(ProposalModel dbObject) { ProposalListItem item = new ProposalListItem(); item.title = dbObject.getTitle(); item.talk = dbObject; return item; }
public static ProposalModel detach(ProposalModel item) { Hibernate.initialize(item); Hibernate.initialize(item.getVotes()); return item; }