I have a collection of Answer's (IList<Answer>
) and two tables(Answer and AnswerHist).
I want to do something along the lines of:
Get the current answers from db.
save(Answers, "AnswerHist");
delete(Answers, "Answer");
Answers = questions
.Select(x => new Answer(response)
{
QuestionID = x.QuestionID,
Value = x.Answer.Value,
Bool = x.Answer.Bool,
Date = x.Answer.Date,
Number = x.Answer.Number,
Text = x.Answer.Text
})
.ToList<Answer>();
save(Answers, "Answer");
Basicly, save the answers to the history table, delete the answers from the answer table, then update the answers and insert them in the answer table.
Any easy way to make hibernate save the same class vs multiple identical tables?