Delete event and annotations#330
Open
colinRenaud wants to merge 14 commits intoOpenSILEX:masterfrom
colinRenaud:delete_event_and_annotations
Open
Delete event and annotations#330colinRenaud wants to merge 14 commits intoOpenSILEX:masterfrom colinRenaud:delete_event_and_annotations
colinRenaud wants to merge 14 commits intoOpenSILEX:masterfrom
colinRenaud:delete_event_and_annotations
Conversation
added 9 commits
December 4, 2019 11:48
the connection is in a good state. Signed-off-by: renaud colin <renaud.colin@inra.fr>
Signed-off-by: renaud colin <renaud.colin@inra.fr>
Signed-off-by: renaud colin <renaud.colin@inra.fr>
Signed-off-by: renaud colin <renaud.colin@inra.fr>
Signed-off-by: renaud colin <renaud.colin@inra.fr>
from a DeleteDTO and a Rdf4jDAO. Signed-off-by: renaud colin <renaud.colin@inra.fr>
Signed-off-by: renaud colin <renaud.colin@inra.fr>
Signed-off-by: renaud colin <renaud.colin@inra.fr>
Signed-off-by: renaud colin <renaud.colin@inra.fr>
added 2 commits
December 4, 2019 15:33
var args in order to create event(s) and/or annotation(s) Signed-off-by: renaud colin <renaud.colin@inra.fr>
object creation Signed-off-by: renaud colin <renaud.colin@inra.fr>
vincentmigot
suggested changes
Dec 4, 2019
vincentmigot
left a comment
There was a problem hiding this comment.
Commentaire général:
- Attention à l'indentation
- Déclarer les variables une par une avec des noms significatif où au pire un commentaire expliquant à quoi elle correspondent
- Commentaire javadoc
- Commentaire plutôt sur leur lignes qu'à la fin
Comment on lines
534
to
537
| Node s = NodeFactory.createVariable("s"), s2 = NodeFactory.createVariable("s2"), s3 = NodeFactory.createVariable("s3"), | ||
| p = NodeFactory.createVariable("p"), o = NodeFactory.createVariable("o"), | ||
| oaTargetPred = NodeFactory.createURI(Oa.RELATION_HAS_TARGET.toString()), | ||
| annotationNode = NodeFactory.createURI(annotationUri); |
Comment on lines
569
to
573
| Node s = NodeFactory.createVariable("s"), | ||
| p = NodeFactory.createVariable("p"), | ||
| p2 = NodeFactory.createVariable("p2"), | ||
| o = NodeFactory.createVariable("o"), | ||
| annotationNode = NodeFactory.createURI(annotationUri); |
Comment on lines
596
to
598
| update.execute(); // first delete all annotation which has the annotationUri as target | ||
| update = conn.prepareUpdate(QueryLanguage.SPARQL,removeAnnotationQuery); | ||
| update.execute(); // then delete the annotation itself |
There was a problem hiding this comment.
Met les commentaires sur leur propre ligne
|
|
||
| AnnotationDAO annotationDAO = new AnnotationDAO(user); | ||
| RepositoryConnection conn = getConnection(); | ||
| annotationDAO.setConnection(conn); // make sure the two DAO use the same connection |
| throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. | ||
| public void delete(List<Event> events) throws DAOPersistenceException, Exception { | ||
|
|
||
| List<String> uris = events.stream().map(event -> event.getUri()) // get all events URIs into an ArrayList via Stream API |
| commitTransaction(); | ||
| } catch (RepositoryException | UpdateExecutionException e) { | ||
| rollbackTransaction(); | ||
| returnedException = new DAOPersistenceException(e); |
Comment on lines
654
to
657
| finally { | ||
| if(returnedException != null) | ||
| throw returnedException; | ||
| } |
| returnedException = new DAOPersistenceException(e); | ||
| } catch(Exception e) { | ||
| rollbackTransaction(); | ||
| returnedException = e; |
There was a problem hiding this comment.
Idem throw et explique la différence entre les deux catch
phis2-ws/src/main/java/opensilex/service/resource/AnnotationResourceService.java
Show resolved
Hide resolved
| /** | ||
| * Try to delete an annotation about one event | ||
| */ | ||
| void test_delete_annotation() throws DAOPersistenceException, Exception { |
added 2 commits
December 13, 2019 00:52
Improve corresponding Services and unit tests documentation and code style.
…ions Signed-off-by: renaud colin <renaud.colin@inra.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- Should be merged after #329 since basic class for RDf4jDAO test in present in #329.
Branch content :