The instantiate method's signature is:
public Object instantiate(String entityName,
EntityMode entityMode,
Serializable id)
Inside the method, I'm supposed to call the desired constructor, set the ID, and return the result. I get that. What I don't get is why is a string passed in instead of a Class? I have to reflect the string to a Class on every call. That seems really inefficient. Is there a map of strings to Classes in hibernate I can get to? I haven't found any documentation on such a map. NHibernate passes in a Type.
|