-Implementation of the in-model methods to query database

Signed-off-by: Mario <mariojothy@gmail.com>