Package org.jboss.dna.common.jdbc.model.api

Examples of org.jboss.dna.common.jdbc.model.api.SqlTypeInfo


    }

    public void testAddSqlTypeInfo() {
        String NAME = "My Name";
        // create
        SqlTypeInfo object = new DefaultModelFactory().createSqlTypeInfo();
        // set
        object.setName(NAME);
        // add
        bean.addSqlTypeInfo(object);
        // check
        assertFalse(bean.getSqlTypeInfos().isEmpty());
    }
View Full Code Here


    }

    public void testDeleteSqlTypeInfo() {
        String NAME = "My Name";
        // create
        SqlTypeInfo object = new DefaultModelFactory().createSqlTypeInfo();
        // set
        object.setName(NAME);
        // add
        bean.addSqlTypeInfo(object);
        // check
        assertFalse(bean.getSqlTypeInfos().isEmpty());
        // delete
View Full Code Here

    }

    public void testFindSqlTypeInfoByTypeName() {
        String NAME = "My Name";
        // create
        SqlTypeInfo object = new DefaultModelFactory().createSqlTypeInfo();
        // set
        object.setName(NAME);
        // add
        bean.addSqlTypeInfo(object);
        // check
        assertSame(object, bean.findSqlTypeInfoByTypeName(object.getName()));
    }
View Full Code Here

        Integer maxScale = getInteger(resultSet, "MAXIMUM_SCALE", false);
        // radix
        Integer radix = getInteger(resultSet, "NUM_PREC_RADIX", false);

        // create SQL type info object
        SqlTypeInfo typeInfo = factory.createSqlTypeInfo();

        // ***************************
        // *** DatabaseNamedObject ***
        // ***************************

        // set name
        typeInfo.setName(typeName);
        // set remarks
        // typeInfo.setRemarks (remarks); // N/A
        // TODO set extra properties
        // typeInfo.addExtraProperty (String key, Object value);

        // *******************
        // *** SqlTypeInfo ***
        // *******************

        // Localized type name
        typeInfo.setLocalizedTypeName(localTypeName);
        // SQL type nullability
        typeInfo.setNullabilityType(getNullabilityType(nullableType));
        // SQL type from java.sql.Types
        typeInfo.setSqlType(getSqlType(dataType));
        // precision
        typeInfo.setPrecision(precision);
        // fixed precision scale
        typeInfo.setFixedPrecisionScale(fixedPrecisionScale);
        // number precision radix
        typeInfo.setNumberPrecisionRadix(radix);
        // minimum scale supported
        typeInfo.setMinScale(minScale);
        // maximum scale supported
        typeInfo.setMaxScale(maxScale);
        // literal prefix
        typeInfo.setLiteralPrefix(literalPrefix);
        // literal suffix
        typeInfo.setLiteralSuffix(literalSuffix);
        // parameters used in creating the type (may be null)
        typeInfo.setCreateParams(createParams);
        // Case Sensitive
        typeInfo.setCaseSensitive(caseSensitive);
        // searchability type
        typeInfo.setSearchabilityType(getSearchabilityType(searchableType));
        // Unsigned
        typeInfo.setUnsigned(unsignedAttribute);
        // Auto Increment
        typeInfo.setAutoIncrement(autoIncrement);

        // add SQL type info to the list
        database.addSqlTypeInfo(typeInfo);

        // log
View Full Code Here

TOP

Related Classes of org.jboss.dna.common.jdbc.model.api.SqlTypeInfo

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.