criteria builder and entity handler