Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-03-13 17:10:02 +0000
committerEike Stepper2010-03-13 17:10:02 +0000
commit72090604b2546dc8f2369b3924116b29d98b33b8 (patch)
tree311d91dcea415cf41db28e08fd67012c86249ec2 /plugins/org.eclipse.net4j.db.derby
parente2fba9bb3a2edaf28abac46bb3eae3149708e1c1 (diff)
downloadcdo-72090604b2546dc8f2369b3924116b29d98b33b8.tar.gz
cdo-72090604b2546dc8f2369b3924116b29d98b33b8.tar.xz
cdo-72090604b2546dc8f2369b3924116b29d98b33b8.zip
[256936] Support for Offline Mode
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256936
Diffstat (limited to 'plugins/org.eclipse.net4j.db.derby')
-rw-r--r--plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/derby/DerbyAdapter.java57
1 files changed, 1 insertions, 56 deletions
diff --git a/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/derby/DerbyAdapter.java b/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/derby/DerbyAdapter.java
index 83e2b904ae..d97d0d76c1 100644
--- a/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/derby/DerbyAdapter.java
+++ b/plugins/org.eclipse.net4j.db.derby/src/org/eclipse/net4j/db/derby/DerbyAdapter.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
@@ -14,8 +14,6 @@ import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.db.ddl.IDBField;
import org.eclipse.net4j.spi.db.DBAdapter;
-import java.util.StringTokenizer;
-
/**
* @author Eike Stepper
* @since 2.0
@@ -70,61 +68,8 @@ public abstract class DerbyAdapter extends DBAdapter
return super.getTypeName(field);
}
- @Override
- public void appendValue(StringBuilder builder, IDBField field, Object value)
- {
- Object newValue = value;
- if (value instanceof Boolean)
- {
- newValue = (Boolean)value ? 1 : 0;
- }
- else if (value instanceof String)
- {
- // Derby just adds one additional single quote for a single quote
- String str = (String)value;
- StringTokenizer tokenizer = new StringTokenizer(str, "\'", true); // split on single quote //$NON-NLS-1$
- StringBuilder newValueBuilder = new StringBuilder();
-
- while (tokenizer.hasMoreTokens())
- {
- String current = tokenizer.nextToken();
- if (current.length() == 0)
- {
- continue;
- }
-
- if (current.length() > 1) // >1 -> can not be token -> normal string
- {
- newValueBuilder.append(current);
- }
- else
- { // length == 1
- newValueBuilder.append(processEscape(current.charAt(0)));
- }
- }
-
- newValue = newValueBuilder.toString();
- }
- else if (value instanceof Character)
- {
- newValue = processEscape((Character)value);
- }
-
- super.appendValue(builder, field, newValue);
- }
-
public String[] getReservedWords()
{
return RESERVED_WORDS;
}
-
- private Object processEscape(char c)
- {
- if (c == '\'') // one single quote -->
- {
- return "\'\'"; // results two single quotes //$NON-NLS-1$
- }
-
- return c; // no escape character --> return as is
- }
}

Back to the top