Config config = em.find(Config.class, 1); 改为 Config config = em.find(Config.class, 1L); 参数1默认会转化为int类型