Jun 6, 2017

[HDGEM] JPA offers polymorphic queries

JPA offers polymorphic queries

For example a findAll DAO method can be implemented as follows:

public List<T> findAll() {
CriteriaBuilder builder = entityManager

CriteriaQuery<T> criteria = builder
.createQuery( entityClass );
criteria.from( entityClass );

return entityManager
.createQuery( criteria )

Posted By Blogger to HDGEM at 6/06/2017 12:46:00 AM
Post a Comment

Featured Post

Trading volumes of most major cryptocurrencies across leading exchanges remain low overall

Bitcoin's daily trading volume has been relatively low