Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
encounters
EncounterBasedCommunication
Commits
d2ff4ab5
Commit
d2ff4ab5
authored
Jul 12, 2018
by
Roberta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
needs cleanup
parent
79ead07d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
ebclibrary/src/main/java/org/mpisws/encounters/dbplatform/ContentProviderBase.java
...org/mpisws/encounters/dbplatform/ContentProviderBase.java
+11
-7
ebclibrary/src/main/java/org/mpisws/encounters/encounterhistory/bridges/EncounterEntriesBridge.java
...ters/encounterhistory/bridges/EncounterEntriesBridge.java
+1
-1
No files found.
ebclibrary/src/main/java/org/mpisws/encounters/dbplatform/ContentProviderBase.java
View file @
d2ff4ab5
...
...
@@ -87,14 +87,18 @@ public abstract class ContentProviderBase extends ContentProvider {
final
SQLiteDatabase
db
=
dbHelper
.
getWritableDatabase
(
GlobalObjectRegistry
.
getObject
(
ESCredentials
.
class
).
getUserHandle
());
final
MatchType
matchType
=
codeToModel
(
matcher
.
match
(
uri
));
final
DBModel
dmb
=
matchType
.
getModel
();
try
{
final
long
rowID
=
db
.
insertOrThrow
(
dmb
.
getTableName
(),
null
,
values
);
if
(
rowID
==
-
1
)
{
throw
new
SQLException
(
"Insert failed"
);
}
final
Uri
insertedRowURI
=
ContentUris
.
withAppendedId
(
EncounterHistoryAPM
.
getContentURI
(
dmb
),
rowID
);
getContext
().
getContentResolver
().
notifyChange
(
insertedRowURI
,
null
);
//Log.d(TAG, "Insert done");
return
insertedRowURI
;
}
catch
(
Exception
e
)
{
Log
.
e
(
TAG
,
e
.
getMessage
());
}
return
null
;
}
public
String
addPKIDConditionToWhereClause
(
final
String
where
,
final
String
pkidString
)
{
// TODO add to whereArgs instead
...
...
ebclibrary/src/main/java/org/mpisws/encounters/encounterhistory/bridges/EncounterEntriesBridge.java
View file @
d2ff4ab5
...
...
@@ -99,7 +99,7 @@ public class EncounterEntriesBridge extends AbstractEncountersBridge<MEncounterE
values
.
put
(
PEncounterEntries
.
Columns
.
userHandle
,
userHandle
);
try
{
context
.
getContentResolver
().
insert
(
EncounterHistoryAPM
.
getContentURI
(
EncounterHistoryAPM
.
encounterEntries
),
values
);
}
catch
(
SQLiteConstraint
Exception
e
)
{
}
catch
(
Exception
e
)
{
Log
.
d
(
TAG
,
"Duplicate insert attempted"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment