开发者

want to pop out some values from mysql database using hibernate

开发者 https://www.devze.com 2023-02-10 18:43 出处:网络
i have a table that is self joined to itself. i want that when i pop out this table using a self join query it will pop out data till it got null in the matching criteria,

i have a table that is self joined to itself. i want that when i pop out this table using a self join query it will pop out data till it got null in the matching criteria, and then stops fetching data and return the rows, that are above the null v开发者_Python百科alue.

thanks


I do not think that this is possible.

Because the repeated self join must be represented in the sql statement, but the number of recursions (number of joins in the query) is only known after fetching the data.

So I think you should do it simple and straig forward: Fetching one entity after an other.

(If this causes performance issues, and you have only a few entities in this table at all, you could think of fetching them all with one statement (Select * FROM table)).

0

精彩评论

暂无评论...
验证码 换一张
取 消