Use the same code for boolean an integer in memory adapter