为什么我这段代码ServiceRegistry sr = new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry();提示线面的错误
Type mismatch: cannot convert from ServiceRegistryBuilder to ServiceRegistry
你这个是导入的包不对
import org.hibernate.service.ServiceRegistryBuilder;
import org.hibernate.service.ServiceRegistry;
导入这两个包就行了