Hi
I have a table with about 100 columns, but I frequently use about 10 of them. I have created two entities and mapped them to the same table as in the example below.
Code:
@Entity
@Table(name="mytable")
public class MyTable{
......
}
@Entity
@Table(name="mytable")
public class MyTableSummary{
......
}
MyTableSummary has only getter methods so that no changes can be made to the table using and object this class. Any updates to the table are made using MyTable entity.
I generally use the MyTableSummary entity in a list that displays all the entries in 'mytable'. This list is fetched using Criteria API.
When I add a new entry in the table or update an existing one using the MyTable entity, these changes are sometimes not reflected in the list of MyTableSummary entities immediately. If I fetch the list again after some time the changes are visible.
I also tried mapping MyTableSummary to a view that selects the 10 columns but sill I got the same issue.
Can anyone please help me understand why this is happening and how can I fix this issue.
Thanks
Amit Khanna