I found that can use @Column annotation for execute subselect,
e.g
private BigDecimal quantityOrders;
@Column(name="(select 2 from dual) as quantityOrders",insertable = false, updatable = false)
public BigDecimal getQuantityOrders() {
return quantityOrders;
}
I tested name with some select and all working. I can link to current table by name and all other in database. It is fantastic, but is it right ?
Where can I find any documentation for that ?
P.S.
In hibernate @Formula I can use 'this' for pointing current table, how do this here (it is important when define other alias e.g. when use CriteriaBuilder)