In a @Formula with complex query using aggregate function and condition on primary key like this:
@Formula("(select count(st._uid) from secondary_table st where st.user_account=uid_)")
if property starts width underscore (i.e. _uid) and both involved tables have same column Hibernate uses secondary_table __uid_ properties in equal condition.
(See attached test_case where last sysout column is wrong)