So lets say I have an object that it stored in a Database:
com.test.dummy.Cat
The cat has an integer id.
Outside of my "world" the reference to the object is a String of the form:
Cat-433
Where 433 is the Cats assigned Database ID.
When I get the String passed to me, I need to be able to find it in the Database.
So I do this:
String[] splitString = str.split("-");
String objectType = splitString[0];
Integer id = Integer.valueOf(splitString[1]);
My question is: What would be the best way to get from Cat to com.test.dummy.Cat so I can do a Class.forName() on the String and find that object in the DB?
I was thinking some sort of XML mapping, or hardcoded pure java mapping. What are my options?