0


Just as in title, to read data I want to use SQL View and to edit the data SQL Table. I've tried to JOIN the tables in JPA, but it's useless.

How to do that?
Greetings, Rafał

Edit: Hmmm, this is a little bit more complex question.
So I have a table and a view in PostgreSQL.
View is used to show the values with simple functions like round or join.

I'm using grid in vaadin which is like a fully functional table, grid accepts one class with data.
It has an inline editing, and I want to show the data on a grid from the view, but edit the data in table.

Rafalsonn
  • 430
  • 7
  • 23
  • 1
    1. why would you even do that? 2. look [here](http://stackoverflow.com/questions/22668350/how-to-map-one-class-with-multiple-tables-in-hibernate-javax-persistance) – XtremeBaumer May 19 '17 at 11:46
  • Hmmm, this is a little bit more complex question. So I have a table and a view in PostgreSQL. View is used to show the values with simple functions like round or join. I'm using grid in vaadin which is like a fully functional table, grid accepts one class with data. It has an inline editing, and I want to show the data on a grid from the view, but edit the data in table. – Rafalsonn May 19 '17 at 12:02
  • A persistable class (entity) is mapped on to a single database object, apart from storing some parts in other places (`@SecondaryTable`). You cannot map it to use one database object for reads and one for writes, since that would leave it open to potential database integrity issues. You can map the view to a different entity to get a read-only view of the real data, and use this different entity just in the read-only context –  May 19 '17 at 12:46

0 Answers0