What is Metamodel API used for

525 Views Asked by At

I understand that metamodel is kind of an abstraction of entity classes, but what exactly it is and how can I profit from that?

1

There are 1 best solutions below

2
On BEST ANSWER

They're used for writing Criteria queries for JPA.

Also, it's used for writing Specifications (if you're using spring data)

Specification<Foo> isBar() {
    return (root, query, builder) -> builder.isNotNull(root.get(Foo_.bar));
}