mySQL延迟
在主外键表存在关系的时候如果加上"lazy=true"的话,则表明延迟,即只查询主表中的内容,而不查询外键表中的内容。
例:
<hibernate-mapping>
<class name="com.pojo.Sortp" table="sortp" catalog="shjdc">
<id name="id" type="java.lang.Integer">
<column name="Id" />
<generator class="assigned" />
</id>
<property name="name" type="java.lang.String">
<column name="Name" length="40" not-null="true" />
</property>
<set name="productses" inverse="true" cascade="all" lazy="true">
<key>
<column name="Sortid" not-null="true" />
</key>
<one-to-many class="com.pojo.Products" />
</set>
</class>
</hibernate-mapping>
一般情况下就是把lazy设为true,而不是false,因为,假如设为false的话,在执行查询主表的同时,相应的子表也会查询,添加了许多无用功。
相关文档:
所需软件(注意版本!):
Apache2.2.3
PHP5.1.5
MySQL5.0.24
这三个软件都是免费的,可从官网上下载,目前我所有的软件名为:
apache_2.2.3-win32-x86-no_ssl.msi
mysql-5.0.24-win32.zip
php-5.1.5-Win32.zip
基于windows操作系统,在Windows XP下安装使用:
1、安装过程:  ......
我的系统是ubuntu6.06,最近新装好的mysql在进入mysql工具时,总是有错误提示:
# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
使用网上介绍的方法修改root用户的密码:
# mysqladmin -uroot -p password 'newpassword'
Enter password:
m ......
问:如果忘记了MySQL的root密码应当如何取回?
答:解决方法如下:
法1:在my.cnf的[mysqld]字段加入:
skip-grant-tables
然后重启你的mysqld,这样久没有密码了.
然后进入mysql。
UPDATE mysql.user SET Password=PASSWORD
('password') WHERE User='root';
成功后
FLUSH PRIVILEGES;
最后去掉my.cnf中的s ......