Created
June 6, 2016 12:19
-
-
Save AledLewis/ab2441121683246bb93337888b93bdda to your computer and use it in GitHub Desktop.
NPE on getTableName
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
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