Opened the door not too interested in this semester's class, called a "practical writing software documentation," and is a teacher does not like to say that more depressing is that two subjects also taught us, there is a what is called "team communication and project management. "

In fact, it is not like the two courses, the main teacher is the role played by magic. Lessons on pulling some baffling things, the relationship with the little book, and then you say that it is so that we understand the strength of the team, engage in some of the more baffling game, but also reports. Should be the most depressing is that she spent a few classes to the role of EQ we talk about the results we come to the conclusion that her own considerable EQ. . . Do not have to, after all, they are teachers, first-served basis or point to it.

Closer to home, one of the "practical writing software documentation" of course, we started to write the document, from needs analysis to outline the design specification, detailed design specification ... ... personal interest in a matter of fact, this is unlikely. But they can not approach, or had to write. Later, the whole of the sentence to the end, we decided to do the project group to achieve them, but also cross-code. The beginning of our group elected a bookstore lease management system, if you want to be lazy, you can directly write a java application, and then click on the database connection with the settlement. But I would like to come back to their own these days to read struts2 with hibernate ears, why not use these two things to be b / s mode then? Also be a chance to practice these two things are bound to be some deeper understanding.

Originally thought that the number of things to learn not hibernate, they look like that model has. In practice, the process of a number of problems encountered in only to find that he committed a very big mistake, it is also the problem so that they have a deeper understanding of hibernate. Encountered a few of them posted about the issue for the next summary.

1. Caused by: org.hibernate.MappingException: entity class not found: Boss
Even the type of Boss and Boss.hbm.xml class mapping file in a package, if not Boss.bhm.xml category specified in the location of Boss, or out of this error, together with the package in front of Boss is like a .

2. Caused by: org.xml.sax.SAXParseException: Attribute "colnumn" must be declared for element type "id".
Plug-ins generated by <id name="id" type="int" column="id"> this code is problematic, always error. But before that there was not any problem, I have not understood What is the reason, That's all replaced by the following:
<id name="id" type="java.lang.Integer">
<column name="id" not-null="true"/>
<generator/>
</ id>
Directly above type can be set to the int.

3. In a period of two operation code to access the same DAO, if run-time, respectively, that is, comment out the visit and only one run is not a problem; but if both are implemented, it would prompt Session was already closed. And is the first operation in the implementation of the close session when finally,
The problem is in the DAO class, create a session in front of HibernateUtil.currentSession using the methods, when in the closed and the use of session.close () method, the problem will be generated. Because I HibernateUtil.currentSession () using a ThreadLocal class, that is to say not for each new request to create a new session, but only to the original content of that session to the new copy in a session, so the use of session.close () method to close the session at the beginning that had to close the session, so this issue will appear; closed session will be replaced by the code HibernateUtil.closeSession () just fine.

4. I found this api method iterate, returns a Iterator type, but when the IDE prompts calls for mandating into Iterator
Iterator iterator = (Iterator) query.iterate ();
Then running directly at the following error
org.hibernate.impl.IteratorImpl cannot be cast to javassist.bytecode.Descriptor $ Iterator

5. Failed to lazily initialize a collection of role: no session or session was closed
Will correspond to the two out of the one-to-many lazy = true change can be lazy = false, this is loaded with real-time delay to load the problem, I personally think there might be time to hibernate in the design take into account the efficiency of the collection with Performance Measures.