merge changes on foodhelper
This commit is contained in:
parent
9a7e57f0a0
commit
2a1bfe1f6c
1 changed files with 6 additions and 5 deletions
|
@ -307,7 +307,7 @@ public class FoodService extends OrmLiteBaseService<DatabaseHelper> {
|
||||||
public boolean createOrUpdateByNS(Food food) {
|
public boolean createOrUpdateByNS(Food food) {
|
||||||
try {
|
try {
|
||||||
// find by NS _id
|
// find by NS _id
|
||||||
if (food._id != null) {
|
if (food._id != null && !food._id.equals("")) {
|
||||||
Food old = this.findByNSId(food._id);
|
Food old = this.findByNSId(food._id);
|
||||||
|
|
||||||
if (old != null) {
|
if (old != null) {
|
||||||
|
@ -322,11 +322,12 @@ public class FoodService extends OrmLiteBaseService<DatabaseHelper> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.getDao().createOrUpdate(food);
|
||||||
|
log.debug("FOOD: New record: " + food.toString());
|
||||||
|
this.scheduleFoodChange();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
this.getDao().createOrUpdate(food);
|
|
||||||
log.debug("FOOD: New record: " + food.toString());
|
|
||||||
this.scheduleFoodChange();
|
|
||||||
return true;
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error("Unhandled exception", e);
|
log.error("Unhandled exception", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue