I have just been able to get such a thing in the past 4 hours: there is such a way in Hibernate: Net.sf.Hibernate.Session.Load (Class, Serializable), the second parameter, I am in one The data type used in the project is incoming compilation. There is no problem (I suspect that I have a mistake in this project, sweat ~), but I use the long type in another project to say that the method can not find , I wonder, I am completely COPY in the first project. Why do I see such an example in Hibernate's documentation: Cat Fritz = (CAT) sess.load (cat.class, generated);
// you need to wrapprimitive IdentifierSlong pkid = 1234; domesticcat pk = (Domsticcat) sess.load (catch); Cat cat = new domesticcat (); // load pk ''s State Into Catsess.Load (CAT, New Long (PKID)); set kittens = cat.getkittens (); I saw the first calling Load method should be a long type, then why do he have new New Long (pkid), ok you need to wrapprimitive Identifier. Is Long for a while, there is no Serializable feature, I can't understand it, and I didn't know that the roots were wrong. I actually ran to see the JDK version used by the two projects. Hey, it is true, The version is different, one is Java Version 1.5.0-B64, and the other is Java Version 1.4.2_04-b05, so I change the second version to the second one, ah, depressed still can't. I have never seen such a document online, or I don't look at the document, Khan ING ~~ I have time to study, I am so dizzy, sleepy, sleep, what is going on? ? ?