switched from pure sql to jpa and changed the type from string to enum