Examples of autoIncrement()


Examples of cn.org.zeronote.orm.ORMColumn.autoIncrement()

  public void find(Object... objs) throws IllegalArgumentException, IllegalAccessException, SQLException {
    Class<?> clz = objs[0].getClass();
    Field[] fields = clz.getDeclaredFields();
    for (Field field : fields) {
      ORMColumn oc = field.getAnnotation(ORMColumn.class);
      if (oc != null && oc.physicalPkFld() && oc.autoIncrement()) {
        // 找到最后一个自增id
        QueryRunner qr = new QueryRunner();
        Object identityVal = qr.query(conn, selectKey.getQuery(), new ScalarHandler<Object>());
        Long identity = NumberUtils.parseNumber(identityVal.toString(), Long.class);
       
View Full Code Here

Examples of cn.org.zeronote.orm.ORMColumn.autoIncrement()

  public void find(Object... objs) throws IllegalArgumentException, IllegalAccessException, SQLException {
    Class<?> clz = objs[0].getClass();
    Field[] fields = clz.getDeclaredFields();
    for (Field field : fields) {
      ORMColumn oc = field.getAnnotation(ORMColumn.class);
      if (oc != null && oc.physicalPkFld() && oc.autoIncrement()) {
        // 找到最后一个自增id
        QueryRunner qr = new QueryRunner();
        Object identityVal = qr.query(conn, selectKey.getQuery(), new ScalarHandler<Object>());
        Long identity = NumberUtils.parseNumber(identityVal.toString(), Long.class);
       
View Full Code Here

Examples of com.digitolio.jdbi.annotations.PK.autoIncrement()

    }

    private String getAutoGeneratedInfo(Column column) {
        Field field = column.getField();
        PK annotation = field.getAnnotation(PK.class);
        if (annotation != null && annotation.autoIncrement()) {
            return " auto_increment";
        } else {
            return "";
        }
    }
View Full Code Here

Examples of com.digitolio.jdbi.annotations.PK.autoIncrement()

    }

    private Field getAutoIncrementField(List<Column> pkColumns) {
        for (Column pkColumn : pkColumns) {
            PK annotation = pkColumn.getField().getAnnotation(PK.class);
            if (annotation != null && annotation.autoIncrement()) {
                return pkColumn.getField();
            }
        }
        return null;
    }
View Full Code Here

Examples of com.digitolio.jdbi.annotations.PK.autoIncrement()

    }

    private String getAutoGeneratedInfo(Column column) {
        Field field = column.getField();
        PK annotation = field.getAnnotation(PK.class);
        if (annotation != null && annotation.autoIncrement()) {
            return " auto_increment";
        } else {
            return "";
        }
    }
View Full Code Here

Examples of com.digitolio.jdbi.annotations.PK.autoIncrement()

    }

    private String getAutoGeneratedInfo(Column column) {
        Field field = column.getField();
        PK annotation = field.getAnnotation(PK.class);
        if (annotation != null && annotation.autoIncrement()) {
            return " auto_increment";
        } else {
            return "";
        }
    }
View Full Code Here

Examples of net.canarymod.database.Column.autoIncrement()

            Iterator<Column> it = columns.keySet().iterator();

            Column column;
            while (it.hasNext()) {
                column = it.next();
                if (!column.autoIncrement()) {
                    fields.append("`").append(column.columnName()).append("`").append(",");
                    values.append("?").append(",");
                }
            }
            if (fields.length() > 0) {
View Full Code Here

Examples of net.canarymod.database.Column.autoIncrement()

            Iterator<Column> it = columns.keySet().iterator();
            Column column;
            while (it.hasNext()) {
                column = it.next();
                fields.append("`").append(column.columnName()).append("` ");
                if (column.columnType().equals(Column.ColumnType.PRIMARY) && column.autoIncrement() && column.dataType() == Column.DataType.INTEGER) {
                    fields.append(" INTEGER PRIMARY KEY ASC");
                    if (it.hasNext()) {
                        fields.append(", ");
                    }
                    continue;
View Full Code Here

Examples of net.canarymod.database.Column.autoIncrement()

                }

                if (column.columnType() == Column.ColumnType.PRIMARY) {
                    fields.append(" PRIMARY KEY");
                }
                if (column.autoIncrement()) {
                    fields.append(" AUTOINCREMENT");
                }
                if (it.hasNext()) {
                    fields.append(", ");
                }
View Full Code Here

Examples of net.canarymod.database.Column.autoIncrement()

            Iterator<Column> it = columns.keySet().iterator();

            Column column;
            while (it.hasNext()) {
                column = it.next();
                if (!column.autoIncrement()) {
                    if (sb.length() > 0) {
                        sb.append(" AND '").append(column.columnName());
                    }
                    else {
                        sb.append("'").append(column.columnName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.