Package com.jfinal.plugin.activerecord

Examples of com.jfinal.plugin.activerecord.ActiveRecordPlugin


    // 配置C3p0数据库连接池插件
    C3p0Plugin c3p0Plugin = new C3p0Plugin(getProperty("jdbcUrl"), getProperty("user"), getProperty("password").trim());
    me.add(c3p0Plugin);
   
    // 配置ActiveRecord插件
    ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
    me.add(arp);
    arp.addMapping("blog", Blog.class)// 映射blog 表到 Blog模型
  }
View Full Code Here


        } else {
            jdbcUrl = Const.JDBC_URL;       user = Const.USER;          password = Const.PASSWORD;
        }
        MysqlDataSource ds = new MysqlDataSource();
        ds.setUrl(jdbcUrl);     ds.setUser(user);       ds.setPassword(password);
        ActiveRecordPlugin arp = new ActiveRecordPlugin(ds);
        if (isLocal) {
            arp.setShowSql(true);
        }
        arp.addMapping("module", Module.class).addMapping("topic", Topic.class).addMapping("post", Post.class);
        arp.addMapping("reply", Reply.class).addMapping("user", User.class);
        me.add(arp);
        me.add(new EhCachePlugin());
    }
View Full Code Here

    public HelloImpl() throws RemoteException {
      /**plugin执行start方法后可以在非web等程序中调用数据库操作*/
      DruidPlugin druidPlugin = new DruidPlugin("jdbc:mysql://127.0.0.1/mymall?characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull", "root", "123456");
      druidPlugin.start();
    // 配置ActiveRecord插件
    ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
    arp.start();
    }
View Full Code Here

TOP

Related Classes of com.jfinal.plugin.activerecord.ActiveRecordPlugin

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.