/** * Get the SQL type of this field. * Typically STRING, VARCHAR, or LONGSTRING if over 127 chars. * @param bIncludeLength Include the field length in this description. * @param properties Database properties to determine the SQL type. */ public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) { String strType = (String)properties.get(DBSQLTypes.STRING); if (strType == null) strType = "VARCHAR"; // The default SQL Type if (this.getMaxLength() < 127) { String strStart = (String)properties.get("LONGSTRINGSTART"); if (strStart != null) { int iStart = Integer.parseInt(strStart); if (iStart < this.getMaxLength()) strType = (String)properties.get("LONGSTRING"); } } if (bIncludeLength) strType += "(" + Integer.toString(this.getMaxLength()) + ")"; return strType; } /**
/** * Get the SQL type of this field. * Typically STRING, VARCHAR, or LONGSTRING if over 127 chars. * @param bIncludeLength Include the field length in this description. * @param properties Database properties to determine the SQL type. */ public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) { String strType = (String)properties.get(DBSQLTypes.STRING); if (strType == null) strType = "VARCHAR"; // The default SQL Type if (this.getMaxLength() < 127) { String strStart = (String)properties.get("LONGSTRINGSTART"); if (strStart != null) { int iStart = Integer.parseInt(strStart); if (iStart < this.getMaxLength()) strType = (String)properties.get("LONGSTRING"); } } if (bIncludeLength) strType += "(" + Integer.toString(this.getMaxLength()) + ")"; return strType; } /**
/** * Get the SQL type of this field. * Typically STRING, VARCHAR, or LONGSTRING if over 127 chars. * @param bIncludeLength Include the field length in this description. * @param properties Database properties to determine the SQL type. */ public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) { String strType = (String)properties.get(DBSQLTypes.STRING); if (strType == null) strType = "VARCHAR"; // The default SQL Type if (this.getMaxLength() < 127) { String strStart = (String)properties.get("LONGSTRINGSTART"); if (strStart != null) { int iStart = Integer.parseInt(strStart); if (iStart < this.getMaxLength()) strType = (String)properties.get("LONGSTRING"); } } if (bIncludeLength) strType += "(" + Integer.toString(this.getMaxLength()) + ")"; return strType; } /**
/** * Retrieve (in string format) from this field. * Data is already in string format, so just return it! * @return The string. */ public String getString() { // Usually overidden int maxLength = this.getMaxLength(); String string = (String)this.getData(); if (string == null) return Constants.BLANK; if (string.length() > maxLength) string = string.substring(0, maxLength); return string; } /**
/** * Retrieve (in string format) from this field. * Data is already in string format, so just return it! * @return The string. */ public String getString() { // Usually overidden int maxLength = this.getMaxLength(); String string = (String)this.getData(); if (string == null) return Constants.BLANK; if (string.length() > maxLength) string = string.substring(0, maxLength); return string; } /**
/** * Retrieve (in string format) from this field. * Data is already in string format, so just return it! * @return The string. */ public String getString() { // Usually overidden int maxLength = this.getMaxLength(); String string = (String)this.getData(); if (string == null) return Constants.BLANK; if (string.length() > maxLength) string = string.substring(0, maxLength); return string; } /**
/** * Convert and move string to this field. * Data is already in string format, so just move it! * @param bState the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code. */ public int setString(String strString, boolean bDisplayOption, int iMoveMode) // init this field override for other value { int iMaxLength = this.getMaxLength(); if (strString != null) if (strString.length() > iMaxLength) strString = strString.substring(0, iMaxLength); if (strString == null) strString = Constants.BLANK; // To set a null internally, you must call setData directly return this.setData(strString, bDisplayOption, iMoveMode); } /**
/** * Convert and move string to this field. * Data is already in string format, so just move it! * @param bState the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code. */ public int setString(String strString, boolean bDisplayOption, int iMoveMode) // init this field override for other value { int iMaxLength = this.getMaxLength(); if (strString != null) if (strString.length() > iMaxLength) strString = strString.substring(0, iMaxLength); if (strString == null) strString = Constants.BLANK; // To set a null internally, you must call setData directly return this.setData(strString, bDisplayOption, iMoveMode); } /**
/** * Convert and move string to this field. * Data is already in string format, so just move it! * @param bState the state to set the data to. * @param bDisplayOption Display the data on the screen if true. * @param iMoveMode INIT, SCREEN, or READ move mode. * @return The error code. */ public int setString(String strString, boolean bDisplayOption, int iMoveMode) // init this field override for other value { int iMaxLength = this.getMaxLength(); if (strString != null) if (strString.length() > iMaxLength) strString = strString.substring(0, iMaxLength); if (strString == null) strString = Constants.BLANK; // To set a null internally, you must call setData directly return this.setData(strString, bDisplayOption, iMoveMode); } /**