/** * Inserts the supplied ExtraForm data submission into the extra-form table. * * <p>First the CORE TABLE name will be read from the forms table. Then the SQL INSERT statement * is prepared with placeholders for values and foreign key(s). This SQL INSERT statement is then * parsed for certain keywords to get the foreign key references. Afterwards the final SQL INSERT * statement is created, ready to be used in a PreparedStatement. Finally the insert statement is * executed. * * @param extraForm Object that contains the extra-form submission information that should be * inserted into the extra-form table * @return A boolean, indicating if the insertion of the supplied extra-form submission was * successful * @throws ConstraintViolations if could not insert extra-form data * @see ExtraForm */ @Override public boolean insertExtraFormData(ExtraForm extraForm) throws ConstraintViolations { String formName = extraForm.getFormName(); String tableName = getCoreTableNameFromExtraForm(formName); String query = createInsertSqlStatementWithPlaceholders(extraForm, tableName); // Check for foreign key and insert FK reference data Map<String, String> foreignKeyData = getForeignKeyData(extraForm, query); query = buildInsertStatement(query, foreignKeyData); insertData(extraForm, query); return false; }