Note: This article uses Eclipse3.0.1 (including Chinese) test, Chinese and English should be written according to it. Author Original article address: http://blog.9cbs.net/brom/archive/2004/11/15/182822.aspx
This article is generally written, and it is very helpful for newcomers. However, I also encountered some problems when I practiced, summed it here, I hope everyone will go less. 1.Run's question: "OK, RUN", the author only mentioned here, and for novices, maybe here. How is Run, What is RUN? Come, I will tell you, right click on org.bromon.ziz.java, menu run -> Run .., pop up the settings window, fill in or select Org.Bromon.ziz.POJO. DAO.USERINFODAO, click the "Run" button. 2. Category Library Question: "Note All LIB files for Hibernate, as well as MySQL JDBC driver files", it can be described so that many newcomers will use "Add External JAR" in the "Library" page in the Build Setup dialog box. To join the JAR droved by Hibernate and MySQL, this is not tasteless, but I think, here can write a step, tell novice, develop a good habit, Hibernate library as an example "Add Library" -> User Library -> User Library -> New-> Hibernate-> Add JAR, join all JAR files under Hibernate (including the root directory and jar under the lib directory), which will then establish the Hibernate project in the future, simply select Hibernate in the user library. . 3. Path problem: This is a big problem. If you are a newcomer to run Eclipse, you will do it step by step, you will report an exception ... hibernate.cfg.xml not found ...; resolve: Copy this file to SRC The directory is OK. Don't worry, have not finished, we found a problem, how did you generate a class? There is no Class directory, how do you do it? One check, found that Class is in the same directory with Java. It turned out that it was not set correctly when establishing a Java project. Solve: In the "New Java Project" dialog box, "Project Layout" should choose the second "Create a separate source folder and output folder"; for future convenience, click "Default Default" button, option " Source and Output Folders Select the second "folder", the default source and output folders are SRC, BIN, and Classes will be created automatically. The application is then approved. After setting this setting, there will be no problem in accordance with the article step by art. In addition, when establishing mapping files in the article, the path in Container is / zizz/src/org/bromon.zizz.pojo, which does not match the path in the figure, need to manually select SRC. However, the choice is not selected, there is no impact on the results of the operation. 4. A little supplement: The modification mentioned in the article is Identity, in fact, you can set it when you create this file, the specific practice is: New -> Others-> Hibernate Mapping File-> Next, Click the Properties page and fill in Identity in the ID Generator. I am actually a newbie, take an article, I hope that according to a step in step, it is very wasteful.