Do total calorie calculation in java code, only use the database as a data store