Package org.apache.empire.data

Examples of org.apache.empire.data.DataType


     *
     * @return true if column is a numeric column
     */
    public boolean isNumericColumn()
    {
        DataType type = getDataType();
        return (type==DataType.INTEGER || type==DataType.DECIMAL || type==DataType.FLOAT || type==DataType.AUTOINC);
    }
View Full Code Here


     *
     * @return true if column is a date based column
     */
    public boolean isDateColumn()
    {
        DataType type = getDataType();
        return (type==DataType.DATE || type==DataType.DATETIME);
    }
View Full Code Here

     *
     * @return true if column is a large object column
     */
    public boolean isLOBColumn()
    {
        DataType type = getDataType();
        return (type==DataType.CLOB || type==DataType.BLOB);
    }
View Full Code Here

            log.error("Index out of range: " + index);
            return null;
        }
        try
        { // Get Value from Resultset
            DataType dataType = colList[index].getDataType();
            return db.driver.getResultValue(rset, index + 1, dataType);

        } catch (Exception e)
        {
            log.error("getValue exception", e);
View Full Code Here

            select(columns.get(i));
    }
   
    private boolean useCmdParam(DBColumn col)
    {
        DataType dt = col.getDataType();
        return ( dt==DataType.BLOB || dt==DataType.CLOB );
    }
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    public DBColumnExpr decode(Map valueMap, Object otherwise)
    {
        // Detect data type
        DataType dataType = DataType.UNKNOWN;
        if (otherwise!=null)
        {
            dataType = detectDataType(otherwise);
        }
        if (dataType==DataType.UNKNOWN)
View Full Code Here

        if (StringUtils.isEmpty(tag))
            tag="span";
        writer.startElement(tag, this);
        // Detect type and additional style
        String addlStyle = null;
        DataType dataType = vi.getColumn().getDataType();
        if (dataType.isNumeric())
        {   try {
                Object val = helper.getDataValue(true);
                if (val!=null && ObjectUtils.getInteger(val)<0)
                    addlStyle = "eValNeg";
            } catch(Exception e) {
View Full Code Here

        {   // Auto-detect
            if (getValueOptions()!=null)
                controlType = SelectInputControl.NAME;
            else
            {   // get from data type
                DataType dataType = column.getDataType();
                controlType = FacesUtils.getFacesApplication().getDefaultControlType(dataType);
            }
            // get default control
            control = InputControlManager.getControl(controlType);
            // Still not? Use Text Control
View Full Code Here

        // Trim
        if (hasFormatOption(ii, "notrim")==false)
            value = value.trim();
        // Check Data Type
        Column column = ii.getColumn();
        DataType type = column.getDataType();
        if (type.isText())
            return value;
        // Check other types
        if (type==DataType.INTEGER)
        {   NumberFormat nf = NumberFormat.getIntegerInstance(ii.getLocale());
            return parseNumber(value, nf);
View Full Code Here

            // Empty String
            return "";
        }
        // Format Value
        Column column = vi.getColumn();
        DataType dataType = getValueType(value, (column != null) ? column.getDataType() : DataType.UNKNOWN);
        if (dataType == DataType.TEXT || dataType == DataType.UNKNOWN)
        { // String
            String s = String.valueOf(value);
            if (hasFormatOption(vi, "noencode"))
                return s;
View Full Code Here

TOP

Related Classes of org.apache.empire.data.DataType

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.