I have a table(MySql) like
(ID(primary-key), Name, rootId)
(2, asdf, 1)
(3, sdf, 1)
(12, tew, 4)
(13, erwq, 4)
Now I want to select distinct root tsg_ids present in database. In this case It should return 1,4.
I tried
List<Entity> entityList = Entity.find(SELECT DISTINCT t.rootId from table t).list().
In debug mode, I see entity list contains ("1", "4"). Entity.find() can only be taken into "Entity" object, but what I am getting from select query is String. So, I was not able to convert the Entity object to String object in this case.
Is there a way to get distinct values of a non-primary column using PanacheEntity?