09 2012 档案

摘要:1 inverse="true"inverse:反转控制器的意思!现在有两个表,用户表infoUser和消息表Message,infoUser实体类配置文件 1 <hibernate-mapping> 2 <class name="com.org.entity.Infouser" table="infouser" catalog="xx"> 3 <id name="uid" type="java.lang.Integer"> 4 <c 阅读全文
posted @ 2012-09-24 14:34 小伙、不一般 阅读(3835) 评论(0) 推荐(1)
摘要:1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans 3 xmlns="http://www.springframework.org/schema/beans" 4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 5 xmlns:p="http://www.springframework.org/schema/p" 6 xsi:schemaLocation="ht 阅读全文
posted @ 2012-09-24 09:25 小伙、不一般 阅读(419) 评论(0) 推荐(0)
摘要:我建了4个表,1 Cascade //级联inverse //由谁控制Course 主键 kid 科目表Student 主键 sid 学生表 外键cidClazz cid 班级表stu_course 关联表 主键scid 外键 sid kid;班级和学生是一对多的关系那么学生对班级就是一对多stu.hbm.xml <many-to-one name="clazz" class="com.org.entity.Clazz" fetch="select" lazy="false"> <column n 阅读全文
posted @ 2012-09-12 09:06 小伙、不一般 阅读(323) 评论(0) 推荐(0)
摘要:BaseHibernate 1 package com.proj.dao; 2 3 import java.io.Serializable; 4 5 import org.hibernate.HibernateException; 6 import org.hibernate.Session; 7 import org.hibernate.SessionFactory; 8 import org.hibernate.Transaction; 9 import org.hibernate.cfg.Configuration;10 11 public class BaseHibernateDa.. 阅读全文
posted @ 2012-09-10 11:31 小伙、不一般 阅读(1157) 评论(0) 推荐(0)
摘要:1 在不需要编写init和destroy方法的时候,只需要从AbstractInterceptor继承而来,实现intercept方法即可。 2 3 4 5 我们尝试编写一个Session过滤用的拦截器,该拦截器查看用户Session中是否存在特定的属性(LOGIN属性) 6 如果不存在,中止后续操作定位到LOGIN,否则执行原定操作,代码为: 7 8 public class CheckLoginInterceptor extends AbstractInterceptor { 9 10 public static final String LOGIN_KEY = "LO... 阅读全文
posted @ 2012-09-08 15:34 小伙、不一般 阅读(299) 评论(0) 推荐(0)
摘要:1 <%@ taglib prefix="s" uri="/struts-tags" %>2 <%@ taglib prefix="sd" uri="/struts-dojo-tags" %>上边是引入标签库页面显示日期文本<sd:datetimepicker name="prop4" displayFormat="yyyyMMdd" toggleType="explode" ></sd:datetimepicke 阅读全文
posted @ 2012-09-07 15:38 小伙、不一般 阅读(237) 评论(0) 推荐(0)