Added support for varying ID types (int/long) for repositories.

Attempted to use an Integer as an ID and got class cast exceptions. Ended up adding support for other primitives.