I am currently getting a NullPointerException when I check if a Long value is null and then also trying to set the value initially as 1 if it is null (as a sequence counter)