Class ClassUtils

java.lang.Object
ch.tocco.nice2.persist.core.api.util.ClassUtils

public abstract class ClassUtils extends Object
  • Method Details

    • loadEntityClassByName

      public static <T extends Entity> Class<T> loadEntityClassByName(org.hibernate.metamodel.model.domain.JpaMetamodel metamodel, String entityName)
      Loads the class of an entity by its (simple or fully-qualified) name. The class is loaded from the JpaMetamodel. This is important because these classes are generated during the hibernate initialization - if hibernate is not loaded yet, the class does not exist yet! Getting them from the JpaMetamodel ensures that hibernate is already initialized. Session-only entities are unknown to hibernate and are loaded directly from the classloader.