Hibernate version: 3.2
I have lot of data in the database which is updated thru some different process(Not Hibernate). In UI(where I'm using Hibernate), I just need to read and show this data. I dont need to persist this data from UI. All I need is to display it in UI. This data is stored in legacy database with legacy schema. Some of the data is read from "database view" which is like a table for hibernate. These database views do not have a primary key. As this is read only data, the query or view does not need to have a primary key. Now, I need to map this view to a class which does not have primary key. But hibernate requires either primary key or composite key or natural key.
I'm newbie to hibernate and I tried searching around different forums and googling. But didnt find any solution.
So my question is, Is it possible to have id created in hibernate which is set in java class (POJO), but not persisted in the database. By this POJO's can be uniquely identified in the application and also does not require to be persisted as this is ready only data.
Any suggestions how I can do this? Is there somewhere I can tell that this class is read only and does not need to persist in database, so that hibernate can create id only in POJOs and not store it in table.
Thanks for your help,
Shailendra
|