public void setProperties(Properties p) {
String dialect = ""; // 数据库方言
dialect = p.getProperty("dialect");
if (Common.isEmpty(dialect)) {
try {
throw new PropertyException("dialect property is not found!");
} catch (PropertyException e) {
e.printStackTrace();
}
} else {
try {
dialectObject = (Dialect) Class.forName(dialect)
.getDeclaredConstructor().newInstance();
} catch (Exception e) {
throw new RuntimeException(dialect + ", init fail!\n" + e);
}
}
pageSqlId = p.getProperty("pageSqlId");//根据id来区分是否需要分页
if (Common.isEmpty(pageSqlId)) {
try {
throw new PropertyException("pageSqlId property is not found!");
} catch (PropertyException e) {
e.printStackTrace();
}
}
}