@Bean(name="sessionFactory")
public AnnotationSessionFactoryBean getsessionfactory(){
AnnotationSessionFactoryBean asf=new AnnotationSessionFactoryBean();
asf.setDataSource(this.getdatasource());
Properties pr=new Properties();
pr.put("hibernate.dialect", org.hibernate.dialect.OracleDialect.class);这里就是设置方言的
pr.put("hibernate.show_sql", "true");
//pr.put("hibernate.hbm2ddl.auto", "create");
asf.setHibernateProperties(pr);