Last active
March 13, 2016 19:44
-
-
Save reubenjohn/bd77165d97a1d1edadeb to your computer and use it in GitHub Desktop.
An example of a class that implements SQLEntity to demonstrate the AceQLAndroid module: https://github.com/reubenjohn/aceqlandroid
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
public class Question implements SQLEntity { | |
public String title; | |
public String description; | |
public String username; | |
@Override | |
public String getEntityName() { | |
return "Question"; | |
} | |
@Override | |
public String[] getAttributeNames() { | |
return new String[]{"username", "title", "description"}; | |
} | |
@Override | |
public int onPrepareStatement(PreparedStatement preparedStatement, int i) throws SQLException { | |
preparedStatement.setString(i++, username); | |
preparedStatement.setString(i++, title); | |
preparedStatement.setString(i++, description); | |
return i; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment