Package quickdb.db.dbms.mysql

Examples of quickdb.db.dbms.mysql.ColumnDefined


        array.add(this.ref.readTableName(object.getClass()));

        Field fields[] = object.getClass().getDeclaredFields();
        for (int i = 0; i < fields.length; i++) {
            Annotation ann[] = fields[i].getAnnotations();
            ColumnDefined colDef;
            switch (admin.getDB()) {
                case POSTGRES:
                    colDef = new ColumnDefinedPostgre();
                    break;
                default:
                    colDef = new ColumnDefined();
                    break;
            }
            String name = fields[i].getName();
            collectionBool = false;

            for (int j = 0; j < ann.length; j++) {
                if (ann[j] instanceof Column) {
                    if ((((Column) ann[j]).type() == Properties.TYPES.COLLECTION)
                            || ((Column) ann[j]).ignore()) {
                        collectionBool = true;
                        continue;
                    }
                    if (((Column) ann[j]).name().length() != 0) {
                        name = ((Column) ann[j]).name();
                    }
                } else if (ann[j] instanceof ColumnDefinition) {
                    colDef.setType(def.obtainDataType(
                            ((ColumnDefinition) ann[j]).type()));
                    colDef.setLength(((ColumnDefinition) ann[j]).length());
                    colDef.setNotNull(((ColumnDefinition) ann[j]).notNull());
                    colDef.setDefaultValue(
                            ((ColumnDefinition) ann[j]).defaultValue());
                    colDef.setAutoIncrement(
                            ((ColumnDefinition) ann[j]).autoIncrement());
                    colDef.setUnique(((ColumnDefinition) ann[j]).unique());
                    colDef.setPrimary(((ColumnDefinition) ann[j]).primary());
                    colDef.setFormat(def.obtainColumnFormat(
                            ((ColumnDefinition) ann[j]).format()));
                    colDef.setStorage(def.obtainStorage(
                            ((ColumnDefinition) ann[j]).storage()));
                }
            }
            colDef.setName(name);

            if (primary) {
                array.add(1, colDef);
                primary = false;
            } else if (!collectionBool) {
View Full Code Here

TOP

Related Classes of quickdb.db.dbms.mysql.ColumnDefined

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.