User.java
private int uid;
private String uname;
private String upwd;
private List<Address> addressList=new ArrayList<Address>();
//----------------
private int id;
private String address;
private String code;
private User user;
//---------------
//-----------
<sqlMapConfig>
<settings
cacheModelsEnabled="true"
enhancementEnabled="true"
lazyLoadingEnabled="true"
errorTracingEnabled="true"
maxSessions="1024"
maxTransactions="512"
maxRequests="2048"
useStatementNamespaces="false" />
<transactionManager type="JDBC">
<dataSource type="SIMPLE">
<!-- com.microsoft.sqlserver.jdbc.SQLServerDriver -->
<property name="JDBC.Driver" value="com.mysql.jdbc.Driver" />
<!--jdbc:sqlserver://localhost:1433;databaseName=ibatisorm -->
<property name="JDBC.ConnectionURL" value="jdbc:mysql://localhost:3306/ibatisorm" />
<property name="JDBC.Username" value="root" />
<property name="JDBC.Password" value="root" />
<property name="Pool.MaximumActiveConnections" value="10" />
<property name="Pool.MaximumIdleConnections" value="5" />
<property name="Pool.MaximumCheckoutTime" value="120000" />
<property name="Pool.TimeToWait" value="500" />
<property name="Pool.PingQuery" value="select 1 from TestDB" />
<property name="Pool.PingEnabled" value="false" />
<property name="Pool.PingConnectionsOlderThan" value="1" />
<property name="Pool.PingConnectionsNotUsedFor" value="1" />
</dataSource>
</transactionManager>
<sqlMap resource="sqlMap/User.xml" />
<sqlMap resource="sqlMap/Person.xml" />
</sqlMapConfig>
<sqlMap namespace="User">
<resultMap id="result" class="com.tq365.vo.User">
<result property="uid" column="uid"></result>
<result property="uname" column="uname"></result>
<result property="upwd" column="upwd"></result>
<result property="addressList" column="uid" select="address.findByUid"></result>
</resultMap>
<resultMap id="address_result" class="com.tq365.vo.Address">
<result property="id" column="id"></result>
<result property="address" column="address"></result>
<result property="code" column="code"></result>
<result property="user" column="uid" select="findUserByID"></result>
</resultMap>
<cacheModel id="user-cache" type="LRU">
<flushInterval hours="24"/>
<flushOnExecute statement="insertUser"/>
<flushOnExecute statement="deleteUserByID"/>
<flushOnExecute statement="updateUserByUser"/>
<property name="size" value="1000"/>
</cacheModel>
//---------------------------
<!--分页查询部分 -->
<select id="findAllUserCount" resultClass="int">
select count(*) from t_user
</select>
<select id="findPageUser" parameterClass="int" resultMap="result" cacheModel="user-cache">
select * from t_user limit #start#,5
</select>
数据库中一共才8条记录,还是分页查询,为什么查一下用了两三秒,请前辈们详细告诉下,是什么原因,该怎样改配置文件
........