simple code like hibernate