copy sql as source code for delphi and single quote


#### System information: 
- Windows 10
- DBeaver version 21.1.4.202108020335
- dark theme and office 



#### Describe the problem you're observing:

when i use "copy  sql as source code" and i don't select use string builder option the code generated have half cicle ")" in end of  code. Delphi require string inside single quote at begin and end.  Another problem is when i use single quote inside sql and generation of code. Single quote is in delphi a reserved charater for defining string . If i want use single quote in a string is necessary repeat single quote.
 

#### Example code generate from dbaver
            'SELECT COD_AGE_ID,STATO FROM mytable aa  ' + 
            'where COD_AGE_ID = '00125' ');


   correct version in delphi

            'SELECT COD_AGE_ID,STATO FROM mytable aa  ' + 
            'where COD_AGE_ID = ''00125'' ';

diff --git a/plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/convert/impl/DelphiSQLConverter.java b/plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/convert/impl/DelphiSQLConverter.java
index bcbfb0a563..ecfa7173f5 100644
--- a/plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/convert/impl/DelphiSQLConverter.java
+++ b/plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/convert/impl/DelphiSQLConverter.java
@@ -40,6 +40,7 @@ public class DelphiSQLConverter extends SourceCodeSQLConverter {
                 result.append("Query.Add(");
             }
             String line = sourceLines[i];
+            line = line.replace("'", "''");
             result.append('\\'').append(CommonUtils.escapeJavaString(line));
             if (!trailingLineFeed) {
                 result.append(lineDelimiter);
@@ -48,9 +49,9 @@ public class DelphiSQLConverter extends SourceCodeSQLConverter {
             if (trailingLineFeed) {
                 result.append(lineDelimiter);
             }
-            if ((i < sourceLines.length - 1) && (!useStringBuilder)) {
+            if (i < sourceLines.length - 1 && !useStringBuilder) {
                 result.append(" + \\n");
-            } else {
+            } else if (useStringBuilder){
                 result.append(");\\n");
             }
         }
['plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/convert/impl/DelphiSQLConverter.java']