I have a POJO class (Named "Instance") with attributes to hold information about some features of some instances in our servers. However the source this table's data comes from is not under my control, and requires me to use a custom SQL query (Precisely: select **distinct** assetid, fqdn, department, vdc, from my_table_name
as the table contains compliance results of some rules applied to those instances, which I don't need so I just get the instances ) instead of having the data available in its own table.
So, instead of using @Table
annotation, I'm forced to use some custom query to achieve the same result. However I have been researching and I can't find a way to assign this query to my @Entity
just like I do with @Table("mytable")
. I'd like to be able to use spring-data-jpa-datatables as well, due to the potentially high volume of elements and processing to be done, but I'm not sure if this can be achieved.