List of usage examples for javax.persistence.metamodel Type getJavaType
Class<X> getJavaType();
From source file:org.jdal.dao.jpa.JpaDao.java
/** * @param class1//from w w w .jav a 2s . co m * @return */ private <K> SingularAttribute<? super K, ?> getIdAttribute(Class<K> clazz) { Type<?> type = em.getMetamodel().entity(clazz).getIdType(); EntityType<K> entity = em.getMetamodel().entity(clazz); SingularAttribute<? super K, ?> id = entity.getId(type.getJavaType()); return id; }