Package net.paoding.rose.jade.context.application

Examples of net.paoding.rose.jade.context.application.JadeFactory


    private UserDAO dao;

    @Before
    public void init() {
        DataSource dataSource = DataSources.createUniqueDataSource();
        JadeFactory factory = new JadeFactory(dataSource);
        dao = factory.create(UserDAO.class);
        dao.createTable();
        dao.insert(1, "zhiliang1");
        dao.insert(2, "zhiliang2");
    }
View Full Code Here


        Assert.assertEquals(users, usersFromDB);
    }

    private UserDAO getOneTable() {
        DataSource dataSource = DataSources.createUniqueDataSource();
        JadeFactory factory = new JadeFactory(dataSource);
        UserDAO dao = factory.create(UserDAO.class);
        dao.createTable();
        return dao;
    }
View Full Code Here

     * 散表的一个实现
     * @return
     */
    private UserDAO getHashTables() {
        DataSource dataSource = DataSources.createUniqueDataSource();
        JadeFactory factory = new JadeFactory(dataSource);
        factory.addInterpreter(new ShardInterpreter('$', 2));// Spring下可以配置ShardInterpreter在xml中让jade自动载入
        UserDAO dao = factory.create(UserDAO.class);
        dao.createTableAt(0);
        dao.createTableAt(1);
        return dao;
    }
View Full Code Here

TOP

Related Classes of net.paoding.rose.jade.context.application.JadeFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.