4

I have an application that uses Hibernate. We are moving to JPA 2.1 standard. There are a lot of usage of "org.hibernate.criterion.Example" with its (excludeProperty) feature. Is there any equivalent to "Hibernate Example" in JPA 2.1?

Thanks.

Vlad Mihalcea
  • 123,941
  • 58
  • 509
  • 849
skywards
  • 81
  • 1
  • 8
  • Unfortunately no - this hasn't changed since JPA 2.0. But you can check the anwers in [here](http://stackoverflow.com/questions/2880209/jpa-findbyexample). I would guess for simple use cases you can build something like _wallenborn_ is creating there. – Tobias Liefke Jul 30 '15 at 21:31

1 Answers1

2

JPA doesn't offer this yet but there are some open source frameworks which allow you to query by-example:

Vlad Mihalcea
  • 123,941
  • 58
  • 509
  • 849