问答详情
源自:1-6 生成表结构

为啥代码会被划掉

package entity;




import org.hibernate.Session;

import org.hibernate.SessionFactory;

import org.hibernate.boot.registry.StandardServiceRegistryBuilder;

import org.hibernate.cfg.Configuration;

import org.hibernate.service.ServiceRegistry;

import org.hibernate.tool.hbm2ddl.SchemaExport;

import org.junit.Test;


public class TestStudents {


@Test

public void testSchemaExport(){

Configuration config=new Configuration().configure();

ServiceRegistry serviceRegistry= new StandardServiceRegistryBuilder().applySettings(config.getProperties()).build();

SessionFactory sessionFactory=config.buildSessionFactory(serviceRegistry);

Session session =sessionFactory.getCurrentSession();

SchemaExport export=new SchemaExport(config);

}

}

http://img.mukewang.com/57fdd8550001ce8812410494.jpg

提问者:好想 2016-10-12 14:29

个回答

  • 慕桂英8054818
    2016-10-12 16:42:03
    已采纳

    说明在你这个jdk版本中已经有新的对象去替代这个旧对象了。划掉的意思就是可以用,但是不建议你,建议你用新版本定义的对象!