title: SQLiteException: near "=": syntax error (code 1)
body: <p>I am trying to read a single object from my sqlite database but I am getting this error doing so:</p>
  
  <pre><code>android.database.sqlite.SQLiteException: near "=": syntax error (code 1): , while compiling: SELECT id FROM Property WHERE id =
                                                                                at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
                                                                                at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:887)
                                                                                at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:498)
                                                                                at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
                                                                                at android.database.sqlite.SQLiteProgram.&lt;init&gt;(SQLiteProgram.java:58)
                                                                                at android.database.sqlite.SQLiteQuery.&lt;init&gt;(SQLiteQuery.java:37)
                                                                                at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
                                                                                at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1316)
                                                                                at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1163)
                                                                                at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1034)
                                                                                at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1240)
                                                                                at xdesign.georgi.espc_retrofit.Database.EspcItemDataSource.getPropertyItemById(EspcItemDataSource.java:117)
                                                                                at xdesign.georgi.espc_retrofit.EspcJobSheculerService.onResponse(EspcJobSheculerService.java:84)
  </code></pre>
  
  <p>This is my DataSource class:</p>
  
  <pre><code>public class EspcItemDataSource {
  //The context of the class
  private Context mContext;
  //string tag used for debugging purposes
  private static final String TAG = EspcItemDataSource.class.getSimpleName();
  // SQLiteDatabase object
  private SQLiteDatabase mDatabase;
  // RssFeedSQLiteHelper object
  private EspcSQLiteHelper mDbHelper;
  // string array of all database columns
  private String[] allColumns = {
          EspcSQLiteHelper.COLUMN_ID,
          EspcSQLiteHelper.COLUMN_PRICE,
          EspcSQLiteHelper.COLUMN_ADDRESS,
          EspcSQLiteHelper.COLUMN_USER_ID,
          EspcSQLiteHelper.COLUMN_LAST_UPDATED
  };
  
  /**
   * Constructor of the class
   *
   * @param context normally an Activity object is passed as context
   */
  public EspcItemDataSource(Context context) {
      //instanciate class fields...
      mDbHelper = new EspcSQLiteHelper(context);
      mContext = context;
  }
  
  // open the database for writing...
  public void open() throws SQLException {
      mDatabase = mDbHelper.getWritableDatabase();
  }
  
  /**
   * Method that closes the database for future manipulations
   */
  public void close() {
      mDbHelper.close();
  }
  
  
  public Property getPropertyItemById(int id){
      Cursor cursor = mDatabase.query(EspcSQLiteHelper.TABLE_NAME, new String[] { EspcSQLiteHelper.COLUMN_ID}, EspcSQLiteHelper.COLUMN_ID + " = ",
              new String[] { String.valueOf(id) }, null, null, null, null);
      if (cursor != null)
          cursor.moveToFirst();
  
      return generateObjectFromCursor(cursor);
  }
  
  
  public Property generateObjectFromCursor(Cursor cursor) {
      //check if the cursor is null
      if (cursor == null) {
          //... return
          return null;
      }
  
      Property propertyItem = new Property();
      //set up the object using the cursor object...
      propertyItem.setId(cursor.getInt(cursor.getColumnIndex(EspcSQLiteHelper.COLUMN_ID)));
      propertyItem.setUserID(cursor.getInt(cursor.getColumnIndex(EspcSQLiteHelper.COLUMN_USER_ID)));
      propertyItem.setAddress(cursor.getString(cursor.getColumnIndex(EspcSQLiteHelper.COLUMN_ADDRESS)));
      propertyItem.setPrice(cursor.getString(cursor.getColumnIndex(EspcSQLiteHelper.COLUMN_PRICE)));
      propertyItem.setLastUpdated(cursor.getString(cursor.getColumnIndex(EspcSQLiteHelper.COLUMN_LAST_UPDATED)));
      //return the object
      return propertyItem;
  }
  </code></pre>
  
  <p>I am getting the error when I am trying to get the property here:</p>
  
  <pre><code>for (Property p : response.body()) {
              // Store the property in the database...
              // TODO DO SYNC LOGIC HERE IN A worker thread
              Log.e(TAG, "Property with address: " + p.getAddress());
  
  
              if(mPropertyItemDataSource.ifExistsLocally(p)){
                  // entry exists locally. Check if needs updating...
                  Property localProperty = mPropertyItemDataSource.getPropertyItemById(p.getId());
                  Log.d(TAG,localProperty.toString());
  
              }else{
                  // entry does not exists locally. Create it...
                  mPropertyItemDataSource.createPropertyItem(p);
              }
          }
  </code></pre>