Skip to content

Instantly share code, notes, and snippets.

@AledLewis
Created June 6, 2016 12:19
Show Gist options
  • Save AledLewis/ab2441121683246bb93337888b93bdda to your computer and use it in GitHub Desktop.
Save AledLewis/ab2441121683246bb93337888b93bdda to your computer and use it in GitHub Desktop.
NPE on getTableName
import com.hubspot.rosetta.jdbi.RosettaMapperFactory;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.Handle;
import java.io.File;
/**
* Created by alewis on 06/06/2016.
*/
public class RosettaIssue32 {
public static void main(String[] args){
new File("test.sqlite").delete();
Handle handle = DBI.open("jdbc:sqlite:test.sqlite");
handle.registerMapper(new RosettaMapperFactory());
handle.execute("CREATE TABLE test (initial INT)");
handle.execute("INSERT INTO test VALUES (1)");
B result= handle.createQuery("SELECT (1+initial) value FROM test").mapTo(B.class).first();
System.out.print("result");
}
class B {
int value;
public String toString(){
return ""+ value;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment