creating restrictions to jpa and hibernate