It has been added in JPA 2.0
Usage:
SELECT e.name, CASE WHEN (e.salary >= 100000) THEN 1 WHEN (e.salary < 100000) THEN 2 ELSE 0 END FROM Employee e
Ref: http://en.wikibooks.org/wiki/Java_Persistence/JPQL_BNF#New_in_JPA_2.0
More Related Contents:
- Difference between FetchType LAZY and EAGER in Java Persistence API?
- How to map a composite key with JPA and Hibernate?
- How to map an entity field whose name is a reserved word in JPA
- Do I need elements in persistence.xml?
- What’s the difference between JPA and Hibernate? [closed]
- What is the “owning side” in an ORM mapping?
- What is the solution for the N+1 issue in JPA and Hibernate?
- JPA CascadeType.ALL does not delete orphans
- What is the difference between persist() and merge() in JPA and Hibernate?
- JPQL Create new Object In Select Statement – avoid or embrace?
- What is the difference between Unidirectional and Bidirectional JPA and Hibernate associations?
- How to remove entity with ManyToMany relationship in JPA (and corresponding join table rows)?
- JPA: How to have one-to-many relation of the same Entity type
- JPA/Hibernate Native Queries do not recognize Parameters
- How to solve the LazyInitializationException when using JPA and Hibernate
- JPA – Persisting a One to Many relationship
- How do I properly cascade save a one-to-one, bidirectional relationship on primary key in Hibernate 3.6
- How to call Oracle Function or Procedure using Hibernate (EntityManager) or JPA
- JPA: Implementing Model Hierarchy – @MappedSuperclass vs. @Inheritance
- JPA Criteria builder IN clause query
- Doing an “IN” query with Hibernate
- @Basic(optional = false) vs @Column(nullable = false) in JPA
- The onFlushDirty Hibernate Interceptor method is never called
- How to map a map JSON column to Java Object with JPA
- No operator matches the given name and argument type(s). You might need to add explicit type casts. — Netbeans, Postgresql 8.4 and Glassfish
- Difference between @MapKey, @MapKeyColumn and @MapKeyJoinColumn in JPA and Hibernate
- Batch inserts with JPA/EJB3
- Hibernate vs JPA vs JDO – pros and cons of each? [closed]
- Clarifying terminology – What does “hydrating” a JPA or Hibernate entity mean when fetching the entity from the DB
- Does JPA support mapping to sql views?