Which of the given identifiers can be generated by the RandomGenerator class, which is defined in the com.example package?
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "com.example.RandomGenerator")
private String id;
private String name;
private int age;
// constructors, getters, setters, etc.
}package com.example;
public class RandomGenerator implements IdentifierGenerator {
@Override
public Serializable generate(SharedSessionContractImplementor session, Object object) throws HibernateException {
return createValue();
}
public String createValue() {
Random rn = new Random();
StringBuilder sb = new StringBuilder();
sb.append("hyperskill-");
sb.append(rn.nextInt(10000));
return sb.toString();
}
}