Always get warning when using raw type Lists/Sets/Iterators etc.
public java.util.List /* <-- Warning here */ getUsersByAge(int minAage)
{
org.hibernate.Query q = session.createQuery("from User u where u.age >= :minAge");
q.setInteger("minAge", minAage);
return q.list(); /* <-- Warning here */
}
I've chaged this by
public java.util.List<User> getUsersByAge(int minAage)
{
org.hibernate.Query q = session.createQuery("from User u where u.age >= :minAge");
q.setInteger("minAge", minAage);
return q.list(); /* <-- How do i get rid of the warning here ???? */ }
and
private java.util.Set phoneNumbers = new java.util.HashSet();
/* Warning: Set is a raw type. References to generic type Set<E> should be parameterized */
Anywayz, is there any danger if i ignore the warnings?