Forums Register Login

There are difference between a view and a table from the point of view of Hibernate?

+Pie Number of slices to send: Send
Hi,

I have a application that uses several tables, I would like to change one table for a view that contains the same columns and data types, must I to change the application code (hibernate mapping files, daos etc) or hibernate not disting a table from a view. Suppose that the table and the view are identical.

For example, I develop a application that use a table named APP_TABLE. The application is finished and works perfect, but one day I need to change the APP_TABLE for a view that contains the same data and types (maybe with additional columns but not revelavant)

Must I to change the existing application or the application can work with the view without touch any line of previous code??

Regards.
+Pie Number of slices to send: Send
Yeray,
Yes. Hibernate can use views. Your view needs to be updatable if you are updating it. That sounds obvious, but some complex views are not updatable so it is something to consider.
+Pie Number of slices to send: Send
Hi Jeanne Boyarsk, thank you for your response,

but if I change a table in the data base for a view (with the same structure, colums and data type), can I use the same mapping file or need to change it for use a view ? I dont know if for Hibernate is the same use a view or a table. Consider the following task:

1) create a table and a hibernate mapping file for that table
2) develop an application that use this table
3) drop the table in database and create a view that has the same columns and data type, considere an updatable view
4) Can I use the old code with the view ??

Sorry for my english, thank you very much.
Look! I laid an egg! Why does it smell like that? Tiny ad, does this smell weird to you?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1150 times.
Similar Threads
Database static fields and ResourceBundles
ui beginner feedback for JTable handling kindly wanted
external table
3 tables to one .. one is to many relationship question
JTable Problem...
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 12:48:20.