Code example for Properties

Methods: put

0
    public SessionFactory sessionFactory() throws Exception 
    { 
        AnnotationSessionFactoryBean bean = new AnnotationSessionFactoryBean();
        bean.setDataSource(dataSource());
        bean.setPackagesToScan(new String[] {"org.springframework.issues"});
        bean.setHibernateProperties(hibernateProps());
        bean.afterPropertiesSet();
        return bean.getObject();
    } 
 
    private Properties hibernateProps()
    { 
        Properties jpaProperties = new Properties();
        jpaProperties.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
        jpaProperties.put("hibernate.hbm2ddl.auto", "create-drop");
        jpaProperties.put("hibernate.show_sql", false);
        jpaProperties.put("hibernate.format_sql", true);
        return jpaProperties;
    } 
 
    @Value("${db.driverClass}") private String driverClass;
    @Value("${db.jdbcUrl}") private String jdbcUrl;