com.github.andyshaox.jdbc.annotation.Daos Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of GearEE Show documentation
Show all versions of GearEE Show documentation
Enhance and formating the coding of JDK
package com.github.andyshaox.jdbc.annotation;
import com.github.andyshaox.jdbc.Dao;
/**
*
* Title:
* Descript:
* Copyright: Copryright(c) Mar 9, 2016
* Encoding:UNIX UTF-8
*
* @author Andy.Shao
*
*/
public final class Daos {
public static Dao build(Class> clazz) {
com.github.andyshaox.jdbc.annotation.Dao annotation = clazz.getAnnotation(com.github.andyshaox.jdbc.annotation.Dao.class);
if (annotation == null) return null;
Dao result = Dao.getDefault();
result.setDataBase(annotation.dataBase());
result.setDefineClass(clazz);
result.setDomain(annotation.domain());
Sqls.build(result.getSqls() , clazz);
return result;
}
private Daos() {
throw new AssertionError("No " + Daos.class + " instance for you");
}
}