Created
June 6, 2012 03:19
-
-
Save electrum/2879680 to your computer and use it in GitHub Desktop.
JDBI helpers
This file contains 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
package jdbi.helpers; | |
import org.skife.jdbi.v2.Handle; | |
import org.skife.jdbi.v2.tweak.HandleCallback; | |
public abstract class VoidHandleCallback | |
implements HandleCallback<Void> | |
{ | |
@Override | |
public final Void withHandle(Handle handle) | |
throws Exception | |
{ | |
execute(handle); | |
return null; | |
} | |
protected abstract void execute(Handle handle) | |
throws Exception; | |
} |
This file contains 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
package jdbi.helpers; | |
import org.skife.jdbi.v2.Handle; | |
import org.skife.jdbi.v2.TransactionCallback; | |
import org.skife.jdbi.v2.TransactionStatus; | |
public abstract class VoidTransactionCallback | |
implements TransactionCallback<Void> | |
{ | |
@Override | |
public final Void inTransaction(Handle handle, TransactionStatus status) | |
throws Exception | |
{ | |
execute(handle, status); | |
return null; | |
} | |
protected abstract void execute(Handle handle, TransactionStatus status) | |
throws Exception; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment