wherehows-dao/src/main/java/wherehows/dao/table/BaseDao.java
@SneakyThrows
  @SuppressWarnings("unchecked")
  public <T> T find(Class<T> entityClass, Object primaryKey) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();
    try {
      return (T) entityManager.find(entityClass, primaryKey);
    } finally {
      entityManager.close();
    }
  }
/**
   * Find an entity by primary key
   * @param entityClass T.class the entity class type
   * @param primaryKey Object
   * @param <T> Entity type to find
   * @return An entity
   */
Find an entity by primary key
@param entityClass T.class the entity class type
@param primaryKey Object
@param  Entity type to find
@return An entity
Find an entity by primary key @param entityClass T . class the entity class type @param primaryKey Object @param Entity type to find @return An entity
@SneakyThrows
  @SuppressWarnings("unchecked")
  public <T> T find(Class<T> entityClass, Object primaryKey) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();
    try {
      return (T) entityManager.find(entityClass, primaryKey);
    } finally {
      entityManager.close();
    }
  }
@ SneakyThrows @ SuppressWarnings ( "unchecked" ) public < T > T find ( Class < T > entityClass , Object primaryKey ) { EntityManager entityManager = entityManagerFactory . createEntityManager ( ) ; try { return ( T ) entityManager . find ( entityClass , primaryKey ) ; } finally { entityManager . close ( ) ; } }
Find an entity by primary key
 @param entityClass T.class the entity class type
 @param primaryKey Object
 @param <T> Entity type to find
 @return An entity
Find an entity by primary key @param entityClass T . class the entity class type @param primaryKey Object @param <T > Entity type to find @return An entity