List of usage examples for javax.persistence.metamodel EntityType getVersion
<Y> SingularAttribute<? super X, Y> getVersion(Class<Y> type);
From source file:com.github.gekoh.yagen.util.MappingUtils.java
public static String getVersionFieldName(EntityManagerFactory emf, Class entityClass) { EntityType entityType = emf.getMetamodel().entity(entityClass); SingularAttribute version;// w w w . ja va2 s. c o m if (entityType != null && (version = entityType.getVersion(Long.class)) != null) { return version.getName(); } return null; }