I'm working on an "perfect" Android CRUD, with as many options as possible.
Its purpose is to be opensource and shared.
So, I'm trying to have a nice and indented, readable code, but I'm having the following problem.
That looks ugly :
public Where<Item, Integer> getWhereSearchOnNameLight(String searchName) {
try {
return itemsDao.queryBuilder().selectColumns(Item.COLUMN_ID,
Item.COLUMN_NAME,
Item.COLUMN_CATEGORY_ID)
.where()
.like(Item.COLUMN_NAME, "%" + searchName + "%");
} catch (SQLException e) { e.printStackTrace(); }
return null;
}
This looks pretty :
public Where<Item, Integer> getWhereSearchOnNameLight(String searchName) {
try {
return itemsDao.queryBuilder().selectColumns(Item.COLUMN_ID,
Item.COLUMN_NAME,
.where() Item.COLUMN_CATEGORY_ID)
.like(Item.COLUMN_NAME, "%" + searchName + "%");
} catch (SQLException e) { e.printStackTrace(); }
return null;
}
But the compiler is associating the .where()
with the Item.COLUMN_CATEGORY_ID)
, just because they are on the same line.
I'd like to make him understand that it's only for display purpose, but I can't.
Any ideas?
In java, you can't do that. Maybe you can change their position.
It looks pretty too.