Package org.qdao.annotation

Examples of org.qdao.annotation.Table


      return tableDescriptor;
    }
    // TODO : use reflect to get annotation from table class
    tableDescriptor = new TableDescriptor();

    Table table = (Table) tableClazz.getAnnotation(Table.class);
    if (table != null) {
      tableDescriptor.name = table.name();
      tableDescriptor.description = table.description();
    }

    Field[] fields = tableClazz.getDeclaredFields();
    List<TableDescriptor.ColumnDescription> columnDescriptors =
        new ArrayList<TableDescriptor.ColumnDescription>();
View Full Code Here


   */
  public static TableDescriptor getTableDescriptor(Class<?> tableClazz) {
    // TODO : use reflect to get annotation from table class
    TableDescriptor tableDescriptor = new TableDescriptor();

    Table table = (Table) tableClazz.getAnnotation(Table.class);
    if (table != null) {
      tableDescriptor.name = table.name();
      tableDescriptor.description = table.description();
    }

    Field[] fields = tableClazz.getDeclaredFields();
    List<TableDescriptor.ColumnDescription> columnDescriptors =
        new ArrayList<TableDescriptor.ColumnDescription>();
View Full Code Here

  }

  public static TableDescriptor getTableDescriptor(Class<?> tableClazz) {
    TableDescriptor tableDescriptor = new TableDescriptor();

    Table table = (Table) tableClazz.getAnnotation(Table.class);
    if (table != null) {
      tableDescriptor.name = table.name();
      tableDescriptor.description = table.description();
    }

    Field[] fields = tableClazz.getDeclaredFields();
    List<TableDescriptor.ColumnDescription> columnDescriptors =
        new ArrayList<TableDescriptor.ColumnDescription>();
View Full Code Here

  }

  public static TableDescriptor getTableDescriptor(Class<?> tableClazz) {
    TableDescriptor tableDescriptor = new TableDescriptor();

    Table table = (Table) tableClazz.getAnnotation(Table.class);
    if (table != null) {
      tableDescriptor.name = table.name();
      tableDescriptor.description = table.description();
    }

    Field[] fields = tableClazz.getDeclaredFields();
    List<TableDescriptor.ColumnDescription> columnDescriptors =
        new ArrayList<TableDescriptor.ColumnDescription>();
View Full Code Here

    if ( sqlCache.containsKey(clz) ) {
      // 是否存储?
      sql.append( sqlCache.get(clz) );
    } else {
      StringBuffer symbol = new StringBuffer();
      Table table = (Table) clz.getAnnotation(Table.class);
      if (null == table) {
        throw new RuntimeException("DTO内不含有Table注解Annotation");
      }
      sql.append("INSERT INTO ").append(table.name()).append(" (");
      Field[] fields = clz.getDeclaredFields();
      Object value = null;
      Column column;
      for (int i = 0; i < fields.length; i++) {
        column = fields[i].getAnnotation(Column.class);
View Full Code Here

    //dto.lastTime = new Date();
    dto.realname = "realname";
    dto.username = "username";
   
    Class clz = dto.getClass();
    Table table = (Table) clz.getAnnotation(Table.class);
    if (null == table) {
      throw new RuntimeException("DTO内不含有Table注解Annotation");
    }
    sql.append("INSERT INTO ").append(table.name()).append(" (");
    Field[] fields = clz.getDeclaredFields();
    Object value = null;
    Column column;
    for (int i = 0; i < fields.length; i++) {
      column = fields[i].getAnnotation(Column.class);
View Full Code Here

TOP

Related Classes of org.qdao.annotation.Table

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.