0

Instead of calling SQL function "manually" for every entity, is there any way to map its result to an entity transient field's ?

@XXXX(call function with param ?)
private int calculatedValue;

Thanks

1 Answer 1

2

You should be able to use Hibernate's @Formula annotation:

https://docs.jboss.org/hibernate/orm/5.1/javadocs/org/hibernate/annotations/Formula.html

https://thoughts-on-java.org/hibernate-tips-calculate-entity-attributes-formula/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.