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的话,在执行查询主表的同时,相应的子表也会查询,添加了许多无用功。
相关文档:
关于 PHP 教程的文章已经很多了,今天给大家介绍几个常用的MYSQL语句。
显示数据库或表:
show databases;//然后可以use database_name;
show tables;
更改表名:
alter table table_name rename new_t;
添加列 :
alter table table_name add column c_n column attributes;
删除列:
alter table table_name ......
所需软件(注意版本!):
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、安装过程:  ......
建立条件首先一定要确定自己的mysql,tomcat,eclipse连接是正确的。
index.jsp很简单,就一个跳转。
<%
response.sendRedirect("lg.jsp");
%>
lg.jsp 实现登录框架
<%@ page contentType="text/html; charset=utf-8" %>
<html>
<head>
<title>
login
</title>
</hea ......
以下是完整的例子。
1、新建表
#title: 自定义字符
#auther: 小强(占卜师)
#date:
2008
-
01
-08
drop
table
if
exists
Category;
create
table
Category
(
cateId &nbs ......
对mysql存储过程的简单应用
向表中插入模拟数据,检查分页效果是否出错。
create procedure dowhile()
begin
declare cnt INT default 0;
while cnt<100 do
INSERT INTO `test`.`news` (`F_ID` ,`F_TITLE` ,`F_CLASSID` ,`F_ISUP` ,`F_CONTENT` ,`F_SOURCE` ,`F_DATETIME` ,`F_RE ......