code: public void initJpa() {
      if (jpaPersistenceUnitName != null) {
        jpaEntityManagerFactory = JpaHelper.createEntityManagerFactory(jpaPersistenceUnitName);
      }
      if (jpaEntityManagerFactory != null) {
        sessionFactories.put(EntityManagerSession.class, new EntityManagerSessionFactory(jpaEntityManagerFactory, jpaHandleTransaction, jpaCloseEntityManager));
        VariableType jpaType = variableTypes.getVariableType(JPAEntityVariableType.TYPE_NAME);
        // Add JPA-type
        if (jpaType == null) {
          // We try adding the variable right before SerializableType, if
          // available
          int serializableIndex = variableTypes.getTypeIndex(SerializableType.TYPE_NAME);
          if (serializableIndex > -1) {
            variableTypes.addType(new JPAEntityVariableType(), serializableIndex);
          } else {
            variableTypes.addType(new JPAEntityVariableType());
          }
        }
  
        jpaType = variableTypes.getVariableType(JPAEntityListVariableType.TYPE_NAME);
  
        // Add JPA-list type after regular JPA type if not already present
        if (jpaType == null) {
          variableTypes.addType(new JPAEntityListVariableType(), variableTypes.getTypeIndex(JPAEntityVariableType.TYPE_NAME));
        }
      }
    }
docs: //////////////////////////////////////////////////////////////////////