-1
샘플 하이버 네이트 프로그램을 만들려고하고 있는데, xml 기반의 최대 절전 모드 구성 코드를 사용하고 있기 때문에 주석과 자바 설정을 기반으로 변환하려고합니다. Employee.hbm.xml을 주석 (Employee.class의 @Entity)로 성공적으로 변환했지만 hibernate.cfg.xml에 대해 동일한 작업을 수행 할 수 없습니다.hibernate.cfg.xml을 자바 설정
Configuration cfg = new AnnotationConfiguration().addAnnotatedClass(com.hibernate.apple.Employee.class);
cfg.setProperty("hibernate.hbm2ddl.auto","update");
cfg.setProperty("hibernate.connection.driver_class","com.mysql.jdbc.Driver");
cfg.setProperty("hibernate.dialect","org.hibernate.dialect.MySQLDialect");
cfg.setProperty("hibernate.connection.url","jdbc:mysql://localhost/DataBase");
cfg.setProperty("hibernate.connection.username","xxx");
cfg.setProperty("hibernate.connection.password","xxx");
Session s = cfg.configure().buildSessionFactory().openSession();
Transaction t = s.beginTransaction();
t.begin();
....
하지만 기부 오류 코드 위
Exception in thread "main" org.hibernate.HibernateException: /hibernate.cfg.xml not found
내가 뭔가를 놓친 거지가, 같은를 요청하는 왜의 hibernate.hbm.xml을 대체하는 것입니다?