shillelagh-processor/src/main/java/shillelagh/internal/TableObject.java
private void emitSelectById(JavaWriter javaWriter) throws IOException {
    logger.d("emitSelectById");
    javaWriter.beginMethod(getTargetClass(), $$GET_OBJECT_BY_ID, EnumSet.of(PUBLIC, STATIC), "long",
        "id", "SQLiteDatabase", "db")
        .emitStatement("Cursor cursor = db.rawQuery(\"SELECT * FROM %s WHERE %s  = id\", null)",
            getTableName(), idColumn.getColumnName())
        .emitStatement("%s value = %s(cursor, db).get(0)", getTargetClass(), $$MAP_OBJECT_FUNCTION)
        .emitStatement("cursor.close()")
        .emitStatement("return value")
        .endMethod();
  }
private void emitSelectById(JavaWriter javaWriter) throws IOException {
    logger.d("emitSelectById");
    javaWriter.beginMethod(getTargetClass(), $$GET_OBJECT_BY_ID, EnumSet.of(PUBLIC, STATIC), "long",
        "id", "SQLiteDatabase", "db")
        .emitStatement("Cursor cursor = db.rawQuery(\"SELECT * FROM %s WHERE %s  = id\", null)",
            getTableName(), idColumn.getColumnName())
        .emitStatement("%s value = %s(cursor, db).get(0)", getTargetClass(), $$MAP_OBJECT_FUNCTION)
        .emitStatement("cursor.close()")
        .emitStatement("return value")
        .endMethod();
  }
private void emitSelectById ( JavaWriter javaWriter ) throws IOException { logger . d ( "emitSelectById" ) ; javaWriter . beginMethod ( getTargetClass ( ) , $$ GET_OBJECT_BY_ID , EnumSet . of ( PUBLIC , STATIC ) , "long" , "id" , "SQLiteDatabase" , "db" ) . emitStatement ( "Cursor cursor = db.rawQuery(\"SELECT * FROM %s WHERE %s  = id\", null)" , getTableName ( ) , idColumn . getColumnName ( ) ) . emitStatement ( "%s value = %s(cursor, db).get(0)" , getTargetClass ( ) , $$ MAP_OBJECT_FUNCTION ) . emitStatement ( "cursor.close()" ) . emitStatement ( "return value" ) . endMethod ( ) ; }
Creates function for getting an object by value
Creates function for getting an object by value