You can use generics without trouble - generics are basically ignored, just the erased signatures are considered. Remember that if you have a class like:
Code:
public class MyGenericClass<T> {
// ...
}
There is really also only one generated java class. Thus:
Code:
MyGenericClass<Long> o1 = new MyGenericClass<Long>();
MyGenericClass<Integer> o2 = new MyGenericClass<Integer>();
// o1.getClass() == o2.getClass()
The generic type signature only matters, if you use hibernate annotations which uses it to guess targetEntity types of collections.[/code]