private void generateSqlProperties() {

		StringBuilder sbr = new StringBuilder();

		sbr.append("JNDI.CONNECTION java:comp/env/jdbc/" + this.jndi + "\n\n");

		sbr.append("CLASS.BROKER.IMPL br.com.topsys.database.jdbc.TSDataBaseBrokerImpl\n\n");

		switch (this.database) {

		case DBModel.DB_ORACLE:

			sbr.append("CLASS.SEQUENCE.IMPL br.com.topsys.database.jdbc.sequence.TSSequenceOracleImpl\n\n");

			sbr.append("CODIGO.UNIQUE 1\n\n");

			sbr.append("CODIGO.FOREIGNKEY 2292\n\n");

			sbr.append("CODIGO.RAISE.EXCEPTION 04088\n\n\n");

			break;

		case DBModel.DB_POSTGRES:

			sbr.append("CLASS.SEQUENCE.IMPL br.com.topsys.database.jdbc.sequence.TSSequencePostgresImpl\n\n");

			sbr.append("CODIGO.UNIQUE 23505\n\n");

			sbr.append("CODIGO.FOREIGNKEY 23503\n\n");

			sbr.append("CODIGO.RAISE.EXCEPTION 09000\n\n\n");

			break;

		case DBModel.DB_SQLSERVER:

			sbr.append("CLASS.SEQUENCE.IMPL br.com.topsys.database.jdbc.sequence.TSSequenceSQLServerImpl\n\n");

			sbr.append("CODIGO.UNIQUE 2627\n\n");

			sbr.append("CODIGO.FOREIGNKEY 547\n\n");

			sbr.append("CODIGO.RAISE.EXCEPTION 55555\n\n\n");

			break;

		}

		for (String table : this.tableNames) {

			String tableName = table.toUpperCase();

			String DAOName = this.camelCase(tableName);

			String myClass = DAOName.substring(0, 1).toUpperCase() + DAOName.substring(1, DAOName.length());

			myClass = this.toSingular(myClass);

			sbr.append("#" + myClass + "DAO\n");

			String dao = myClass.toLowerCase() + "dao.";

			this.columns = new ArrayList<String>();

			for (DBModel dbModel : this.tables) {

				if (table.equalsIgnoreCase(dbModel.getTable())) {

					this.columns.add(dbModel.getColumn().toUpperCase());

				}

			}

			String variables = "";

			StringBuilder variablesToChange = new StringBuilder();

			StringBuilder parameters = new StringBuilder();

			for (String coluna : this.columns) {

				variables += ", " + coluna;

				if (!coluna.equals("ID")) {

					variablesToChange.append("," + coluna + " = ?");

				}

				parameters.append(", ?");

			}

			String parametrosStr = parameters.toString();

			variables = variables.replaceFirst(", ", "");

			parametrosStr = parametrosStr.replaceFirst(", ", "");

			sbr.append(dao + "get=SELECT " + variables + " FROM " + tableName + " WHERE ID = ?\n");

			sbr.append(dao + "findall=SELECT " + variables + " FROM " + tableName + "\n");

			String varInsert = " (ID, " + variables.replace(", ID", "");

			varInsert = varInsert.replaceAll("ID, ID,", "ID,");
			
			if(this.database == DBModel.DB_SQLSERVER) {
				
				varInsert = varInsert.replaceAll(" ID, ", "");
				
				varInsert = varInsert.replaceAll("[(]ID, ", "(");
				
				sbr.append(dao + "insert=INSERT INTO " + tableName + varInsert + ") VALUES (" + parameters.toString().replaceFirst(", ", "").replaceFirst("\\?,", "") + ")\n");
				
			} else {
				
				sbr.append(dao + "insert=INSERT INTO " + tableName + varInsert + ") VALUES (" + parameters.toString().replaceFirst(", ", "") + ")\n");
			
			}

			sbr.append(dao + "update=UPDATE " + tableName + " SET " + variablesToChange.toString().replaceFirst(",", "") + " WHERE ID = ?\n");

			sbr.append(dao + "delete=DELETE FROM " + tableName + " WHERE ID = ?\n\n");

		}

		TSFile.criarArquivo(this.directory + SRC + File.separator + CONFIG + File.separator + "sql.properties", sbr.toString(), TSConstant.CHARSET_UTF);

		super.addInfoMessage("File sql.properties created!");

	}