configPlugin (Plugins me)


This method is used to configure JFinal's Plugin. The following code configures the C3p0 database connection pool plug-in and ActiveRecord database access plug-in. Through the following configuration, you can use ActiveRecord in your application to operate the database very conveniently.

public void configPlugin(Pluginsme)
{ loadPropertyFile("your_app_config.txt");
C3p0Plugin c3p0Plugin = new C3p0Plugin(getProperty("jdbcUrl"), getProperty("user") , getProperty("password"));
me.add(c3p0Plugin);
ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);me.add(arp);
arp.addMapping("user",User .class);

JFinal plug-in architecture is one of its main extension methods, which can easily create plug-ins and apply them to projects.