}
@Override
public HTextFlowTarget copyTextFlowTarget(HTextFlow newTf,
HTextFlowTarget tft) throws Exception {
HTextFlowTarget copy =
JPACopier.<HTextFlowTarget> copyBean(tft, "textFlow",
"reviewComments", "history");
copy.setTextFlow(newTf);
copy.setTextFlowRevision(newTf.getRevision());
// copy review comment
copy.setReviewComments(Lists
.<HTextFlowTargetReviewComment> newArrayList());
for (HTextFlowTargetReviewComment comment : tft.getReviewComments()) {
copy.addReviewComment(comment.getComment(), comment.getCommenter());
}
// copy history
for (HTextFlowTargetHistory history : tft.getHistory().values()) {
HTextFlowTargetHistory newHistory =
JPACopier.<HTextFlowTargetHistory> copyBean(history,
"textFlowTarget");
newHistory.setTextFlowTarget(copy);
copy.getHistory().put(newHistory.getVersionNum(), newHistory);
}
return copy;
}