Hi there!
After some time trying to find out a solution for my problem, I have decided to write a post asking for some help. I'll try to explain what I'm trying to do. We are using Hibernate 3.2 and mysql 5.0
I have two different tables, both having exactly the same information.
Code:
CREATE TABLE A(
...
);
CREATE TABLE A_TEMP(
---
);
The A table has all the information but every week, some rows are changed. The process to update the information takes some time but the information has to be ready as soon as possible in table A. So we use A_TEMP to calculate the new data in advance. We have used entity-name to try to use the same java class and be able to differentiate both tables:
Code:
<class name="A" entity-name="A" table="A">
...
</class>
<class name="A" entity-name="A_TEMP" table="A_TEMP">
...
</class>
Then, we try to read from table A and insert into table A_TEMP with the following code:
Code:
List<A> list = (List<A>)session.createQuery(hql).list();
for (A a : list)
{
//calculate A
session.save("A_TEMP", a);
}
But we haven't been able to update the objects in A_TEMP table ....
Any help would be appreciate!
Thanks in advance