If I understand you correctly, do you need a random 5-digit number, without repeating the number?
If so, one way is to shuffle the list of digits 0-9, and then select the first 5 elements.
EDIT
Integer[] digits = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
Random random = new Random();
public Integer[] generateId() {
List<Integer> id = Arrays.asList(digits);
Collections.shuffle(id, random);
return id.subList(0, 5).toArray(new Integer[0]);
}