Hibernate 6.6.x function table

Hello, is possible register a function like

CREATE FUNCTION get_ordine_dettagli(p_id BIGINT, p_data DATE) RETURNS TABLE(id BIGINT, prodotto TEXT, quantita INT, totale NUMERIC) AS $$ BEGIN RETURN QUERY SELECT o.id, p.nome, o.quantita, (o.quantita * p.prezzo) FROM ordine o JOIN prodotto p ON o.prodotto_id = p.id WHERE o.id = p_id AND o.data_ordine = p_data; END; $$ LANGUAGE plpgsql;

and call it in hql with this sintax

`@Query(“SELECT o FROM get_ordine_dettagli(:id, :data) o”) List getDettagliOrdine(@Param(“id”) Long id, @Param(“data”) LocalDate data);

?

Hibernate ORM 7.0 will provide support for set-returning functions. Also see Hibernate ORM User Guide

thanks Beikov, when the final version is available, I will definitely try it!