You're right. @Formula
allows you to use the actual column name.
An important feature of HQL is the use of the java property name to refer to the actual column name. If you want to refer to property names when retrieving a formula value, you can simply implement the formula logic in the receiver of your displayed POJOs.
source share