I have always liked the appfuse framework because it is more standard. Under this framework, you can develop good engineering habits, such as package organization, naming, and engineering management.
The latest version is 1.9.2, which uses a combination of webwork + spring + ibatis. Many problems have been found during use. You can record the Solution Process for reference.
1. dbunit test Oracle
Add scheme = "ABC" to the dbunit task. ABC is the name of the tablespace.
2. ibatis execution error: the SQL Execution statement is empty.
The SQL statements configured in the. xml file are ";". MySQL is not sensitive to commas, but errors may occur in Oracle.
3. Add a record to ibatis, where ID is automatically increased.
Add a selectkey In the insert Segment configuration. Note that the selectkey in the Oracle database must be written before the SQL statement. The SQL statement must contain the ID field.
<insert id="addRole" parameterClass="role">
<selectKey resultClass="java.lang.Long" keyProperty="id">
SELECT SEQ_ROLE_TABLE.nextVal as ID FROM dual
</selectKey>
<![CDATA[
insert into role_table (id, name, description)
values (#id#, #name#, #description#)
]]>
</insert>
Seq_role_table is a sequence object of oralce. It is best to create one for each table.
4. Chinese problems
Displaytag export PDF Chinese problems. This problem cannot be solved simply. You can only download the source code of displaytag. In the inittable () method in org. displaytag. Export. Lateral view. Java, remove the original font fetch statement.
smallFont = FontFactory.getFont(FontFactory.HELVETICA, 7, Font.NORMAL, new Color(0, 0, 0));
Add a new statement for retrieving the Chinese common font
Basefont bfchinese = basefont. createfont ("stsong-light", "UniGB-UCS2-H", basefont. not_embedded );
Font fontchinese = new font (bfchinese, 12, Font. Normal );
Of course, you need to add a package containing the font: itextasian. jar.
5. object initialization Problems
Any object that needs to be created through ibatis must have a construction function with no parameter and public. If there is no explicitly defined
You can also create a function, because no public parameter is provided by default. Without this function, an error occurs when ibatis creates an object.
6. Unit Test Problems
In the DaO layer unit test, if we insert data into the database, the unit test is successful, but the data is not actually in the database! What's going on? In the past, no unit tests configured with Dao in the framework of appfuse were actually submitted, but rolled back after method access was successful.