Skip to content

Instantly share code, notes, and snippets.

@reubenjohn
Last active March 13, 2016 19:44
Show Gist options
  • Save reubenjohn/bd77165d97a1d1edadeb to your computer and use it in GitHub Desktop.
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
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