<commit_before>package bootstrap;

import dao.ProfileDAO;

import dao.TaskSetDAO;
import models.Profile;
import models.TaskSet;

import play.Logger;
import sqlparser.SQLParser;
import sqlparser.SQLStatus;
import view.TaskSetView;

import com.fasterxml.jackson.databind.JsonNode;
import play.libs.Json;

/**
 *
 * @author fabiomazzone
 */
public class TaskSetBootstrap {
    public static void init(){
        if(TaskSetDAO.getAll().size() == 0) {
            Logger.info("Initialize 'TaskSet' data");
            JsonNode node = Json.parse("{\n " +
                                       "   \"taskSetName\":          \"DefaultTaskSet\"," +
                                       "    \"tableDefinitions\": [\n" +
                                       "        {\n" +
                                       "            \"tableName\": \"User\",\n" +
                                       "            \"columns\": [\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"EMail\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": true,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 2\n" +
                                       "                },\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"FirstName\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": false,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 3\n" +
                                       "                },\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"LastName\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": false,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 3\n" +
                                       "                }\n" +
                                       "            ],\n" +
                                       "            \"extensions\": \"INSERT INTO User(EMail, FirstName, LastName) VALUES ('<EMAIL>', 'Fabio', 'Mazzone');\\n \"\n" +
                                       "        },\n" +
                                       "        {\n" +
                                       "            \"tableName\": \"Profile\",\n" +
                                       "            \"columns\": [\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"user\",\n" +
                                       "                    \"dataType\": \"VARCHAR(255)\",\n" +
                                       "                    \"primaryKey\": true,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 2\n" +
                                       "                },\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"username\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": true,\n" +
                                       "                    \"notNull\": false,\n" +
                                       "                    \"datagenSet\": 3\n" +
                                       "                }\n" +
                                       "            ],\n" +
                                       "            \"extensions\": \"INSERT INTO Profile(user, username) VALUES ('<EMAIL>', 'fabiomazzone'); \\n \"\n" +
                                       "        } \n" +
                                       "    ],\n" +
                                       "    \"foreignKeyRelations\": [\n" +
                                       "        {\n" +
                                       "            \"sourceTable\":\"Profile\",\n" +
                                       "            \"sourceColumn\":\"user\",\n" +
                                       "            \"destinationTable\":\"User\",\n" +
                                       "            \"destinationColumn\":\"EMail\"\n" +
                                       "        }\n" +
                                       "    ],\n" +
                                       "    \"tasks\": [" +
                                       "       {\n" +
                                       "               \"taskSet\":                    1,\n" +
                                       "               \"taskText\":                   \"Find all user\",\n" +
                                       "               \"refStatement\":               \"SELECT * FROM User\",\n" +
                                       "               \"evaluationStrategy\":         1,\n" +
                                       "               \"points\":                     1,\n" +
                                       "               \"requiredTerm\":               2,\n" +
                                       "               \"availableSyntaxChecks\":      10,\n" +
                                       "               \"availableSemanticChecks\":    2\n" +
                                       "       }," +
                                       "       {\n" +
                                       "               \"taskSet\":                    2,\n" +
                                       "               \"taskText\":                   \"Find Me\",\n" +
                                       "               \"refStatement\":               \"SELECT * FROM User Where FirstName = 'Fabio'\",\n" +
                                       "               \"evaluationStrategy\":         1,\n" +
                                       "               \"points\":                     1,\n" +
                                       "               \"requiredTerm\":               2,\n" +
                                       "               \"availableSyntaxChecks\":      10,\n" +
                                       "               \"availableSemanticChecks\":    2\n" +
                                       "       }" +
                                       "   ],\n" +
                                       "    \"isHomeWork\":   true\n" +
                                       "}\n");

            Profile profile = ProfileDAO.getByUsername("sqlalchemist");

            TaskSet taskSet = TaskSetView.fromJsonForm(profile, node);
            taskSet.save();
            SQLStatus err;
            if((err = SQLParser.createDB(taskSet)) != null) {
                Logger.warn("TaskSetController.create - " + err.getSqlException().getMessage());
                taskSet.delete();
            }

            Logger.info("Done initializing");
        }
    }
}<commit_msg>More Task in the TaskSet Bootstrap<commit_after>package bootstrap;

import dao.ProfileDAO;

import dao.TaskSetDAO;
import models.Profile;
import models.TaskSet;

import play.Logger;
import sqlparser.SQLParser;
import sqlparser.SQLStatus;
import view.TaskSetView;

import com.fasterxml.jackson.databind.JsonNode;
import play.libs.Json;

/**
 *
 * @author fabiomazzone
 */
public class TaskSetBootstrap {
    public static void init(){
        if(TaskSetDAO.getAll().size() == 0) {
            Logger.info("Initialize 'TaskSet' data");
            JsonNode node = Json.parse("{\n " +
                                       "   \"taskSetName\":          \"DefaultTaskSet\"," +
                                       "    \"tableDefinitions\": [\n" +
                                       "        {\n" +
                                       "            \"tableName\": \"User\",\n" +
                                       "            \"columns\": [\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"EMail\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": true,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 2\n" +
                                       "                },\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"FirstName\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": false,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 3\n" +
                                       "                },\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"LastName\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": false,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 3\n" +
                                       "                }\n" +
                                       "            ],\n" +
                                       "            \"extensions\": \"INSERT INTO User(EMail, FirstName, LastName) VALUES ('<EMAIL>', 'Fabio', 'Mazzone');\\n \"\n" +
                                       "        },\n" +
                                       "        {\n" +
                                       "            \"tableName\": \"Profile\",\n" +
                                       "            \"columns\": [\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"user\",\n" +
                                       "                    \"dataType\": \"VARCHAR(255)\",\n" +
                                       "                    \"primaryKey\": true,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 2\n" +
                                       "                },\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"username\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": true,\n" +
                                       "                    \"notNull\": false,\n" +
                                       "                    \"datagenSet\": 3\n" +
                                       "                }\n" +
                                       "            ],\n" +
                                       "            \"extensions\": \"INSERT INTO Profile(user, username) VALUES ('<EMAIL>', 'fabiomazzone'); \\n \"\n" +
                                       "        } \n" +
                                       "    ],\n" +
                                       "    \"foreignKeyRelations\": [\n" +
                                       "        {\n" +
                                       "            \"sourceTable\":\"Profile\",\n" +
                                       "            \"sourceColumn\":\"user\",\n" +
                                       "            \"destinationTable\":\"User\",\n" +
                                       "            \"destinationColumn\":\"EMail\"\n" +
                                       "        }\n" +
                                       "    ],\n" +
                                       "    \"tasks\": [" +
                                       "       {\n" +
                                       "               \"taskSet\":                    1,\n" +
                                       "               \"taskText\":                   \"Find all user\",\n" +
                                       "               \"refStatement\":               \"SELECT * FROM User\",\n" +
                                       "               \"evaluationStrategy\":         1,\n" +
                                       "               \"points\":                     1,\n" +
                                       "               \"requiredTerm\":               2,\n" +
                                       "               \"availableSyntaxChecks\":      10,\n" +
                                       "               \"availableSemanticChecks\":    2\n" +
                                       "       }," +
                                       "       {\n" +
                                       "               \"taskSet\":                    2,\n" +
                                       "               \"taskText\":                   \"Find Me\",\n" +
                                       "               \"refStatement\":               \"SELECT * FROM User Where FirstName = 'Fabio'\",\n" +
                                       "               \"evaluationStrategy\":         1,\n" +
                                       "               \"points\":                     1,\n" +
                                       "               \"requiredTerm\":               2,\n" +
                                       "               \"availableSyntaxChecks\":      10,\n" +
                                       "               \"availableSemanticChecks\":    2\n" +
                                       "       }" +
                                       "   ],\n" +
                                       "    \"isHomeWork\":   true\n" +
                                       "}\n");

            Profile profile = ProfileDAO.getByUsername("sqlalchemist");

            TaskSet taskSet = TaskSetView.fromJsonForm(profile, node);
            taskSet.save();
            SQLStatus err;
            if((err = SQLParser.createDB(taskSet)) != null) {
                Logger.warn("TaskSetController.create - " + err.getSqlException().getMessage());
                taskSet.delete();
            }
            node = Json.parse("{\n " +
                                       "   \"taskSetName\":          \"DefaultTaskSet\"," +
                                       "    \"tableDefinitions\": [\n" +
                                       "        {\n" +
                                       "            \"tableName\": \"User\",\n" +
                                       "            \"columns\": [\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"EMail\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": true,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 2\n" +
                                       "                },\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"FirstName\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": false,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 3\n" +
                                       "                },\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"LastName\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": false,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 3\n" +
                                       "                }\n" +
                                       "            ],\n" +
                                       "            \"extensions\": \"INSERT INTO User(EMail, FirstName, LastName) VALUES ('<EMAIL>', 'Fabio', 'Mazzone');\\n \"\n" +
                                       "        },\n" +
                                       "        {\n" +
                                       "            \"tableName\": \"Profile\",\n" +
                                       "            \"columns\": [\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"user\",\n" +
                                       "                    \"dataType\": \"VARCHAR(255)\",\n" +
                                       "                    \"primaryKey\": true,\n" +
                                       "                    \"notNull\": true,\n" +
                                       "                    \"datagenSet\": 2\n" +
                                       "                },\n" +
                                       "                {\n" +
                                       "                    \"columnName\": \"username\",\n" +
                                       "                    \"dataType\": \"Varchar(255)\",\n" +
                                       "                    \"primaryKey\": true,\n" +
                                       "                    \"notNull\": false,\n" +
                                       "                    \"datagenSet\": 3\n" +
                                       "                }\n" +
                                       "            ],\n" +
                                       "            \"extensions\": \"INSERT INTO Profile(user, username) VALUES ('<EMAIL>', 'fabiomazzone'); \\n \"\n" +
                                       "        } \n" +
                                       "    ],\n" +
                                       "    \"foreignKeyRelations\": [\n" +
                                       "        {\n" +
                                       "            \"sourceTable\":\"Profile\",\n" +
                                       "            \"sourceColumn\":\"user\",\n" +
                                       "            \"destinationTable\":\"User\",\n" +
                                       "            \"destinationColumn\":\"EMail\"\n" +
                                       "        }\n" +
                                       "    ],\n" +
                                       "    \"tasks\": [" +
                                       "       {\n" +
                                       "               \"taskSet\":                    1,\n" +
                                       "               \"taskText\":                   \"Find all user\",\n" +
                                       "               \"refStatement\":               \"SELECT * FROM User\",\n" +
                                       "               \"evaluationStrategy\":         1,\n" +
                                       "               \"points\":                     1,\n" +
                                       "               \"requiredTerm\":               2,\n" +
                                       "               \"availableSyntaxChecks\":      10,\n" +
                                       "               \"availableSemanticChecks\":    2\n" +
                                       "       }," +
                                       "       {\n" +
                                       "               \"taskSet\":                    2,\n" +
                                       "               \"taskText\":                   \"Find Me\",\n" +
                                       "               \"refStatement\":               \"SELECT * FROM User Where FirstName = 'Fabio'\",\n" +
                                       "               \"evaluationStrategy\":         1,\n" +
                                       "               \"points\":                     1,\n" +
                                       "               \"requiredTerm\":               2,\n" +
                                       "               \"availableSyntaxChecks\":      10,\n" +
                                       "               \"availableSemanticChecks\":    2\n" +
                                       "       }" +
                                       "   ],\n" +
                                       "    \"isHomeWork\":   false\n" +
                                       "}\n");

            profile = ProfileDAO.getByUsername("sqlalchemist");

            taskSet = TaskSetView.fromJsonForm(profile, node);
            taskSet.save();
            if((err = SQLParser.createDB(taskSet)) != null) {
                Logger.warn("TaskSetController.create - " + err.getSqlException().getMessage());
                taskSet.delete();
            }
            Logger.info("Done initializing");
        }
    }
}
{'fraction_non_alphanumeric': 0.12351533416060982, 'fraction_numerical': 0.004609111859599362, 'mean_word_length': 0.42276166456494324, 'pattern_counts': {'":': 168, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 489, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1359439', 'n_tokens_mistral': 4748, 'n_tokens_neox': 4244, 'n_words': 607}