net.gdface.facelog.db.mysql.ManagerUtil Maven / Gradle / Ivy
// ______________________________________________________
// Generated by sql2java - https://github.com/10km/sql2java-2-6-7 (custom branch)
// modified by guyadong from
// sql2java original version https://sourceforge.net/projects/sql2java/
// JDBC driver used at code generation time: com.mysql.jdbc.Driver
// template: manager.util.java.vm
// ______________________________________________________
package net.gdface.facelog.db.mysql;
import java.util.Map;
import java.util.concurrent.Callable;
import net.gdface.facelog.dborm.Manager;
import net.gdface.facelog.db.exception.RuntimeDaoException;
import net.gdface.facelog.dborm.exception.DaoException;
/**
* static method delegation of native manager {@link Manager}
* @author guyadong
*
*/
public class ManagerUtil {
/**
* inject properties to {@link Manager#databaseProperties}
* @param properties
*/
public static final void injectProperties(Map properties){
Manager.injectProperties(properties);
}
public static void runAsTransaction(Runnable fun)throws RuntimeDaoException{
try {
Manager.getInstance().runAsTransaction(fun);
} catch (DaoException e){
throw new RuntimeDaoException(e);
}
}
public static T runAsTransaction(Callable fun)throws RuntimeDaoException{
try {
return Manager.getInstance().runAsTransaction(fun);
} catch (DaoException e){
throw new RuntimeDaoException(e);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy