Skip to content

Get Inserted/Deleted statements on an Update Query #3163

Answered by abrokenjester
daltontc asked this question in Q&A
Discussion options

You must be logged in to vote

You can do something along those lines with a SailConnectionListener. The way to access this is a little bit clunky though. Here's an example:

Repository rep = new SailRepository(new MemoryStore());
try (SailRepositoryConnection conn = (SailRepositoryConnection) rep.getConnection()) {
	NotifyingSailConnection sailConn = (NotifyingSailConnection) conn.getSailConnection();
	sailConn.addConnectionListener(new SailConnectionListener() {

		@Override
		public void statementRemoved(Statement removed) {
			System.out.println("removed: " + removed);
		}

		@Override
		public void statementAdded(Statement added) {
			System.out.println("added: " + added);
		}
	});

	conn.begin();
	conn.add(FOAF.PE…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@daltontc
Comment options

@abrokenjester
Comment options

@daltontc
Comment options

@abrokenjester
Comment options

Answer selected by abrokenjester
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants