??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精选一区,一区二区视频,在线免费日韩 http://www.aygfsteel.com/yiqi/zh-cn Fri, 18 Jul 2025 21:13:24 GMT Fri, 18 Jul 2025 21:13:24 GMT 60 Hibernate懒加载扫?/title> http://www.aygfsteel.com/yiqi/archive/2012/06/18/381046.html民工二代 民工二代 Mon, 18 Jun 2012 15:24:00 GMT http://www.aygfsteel.com/yiqi/archive/2012/06/18/381046.html http://www.aygfsteel.com/yiqi/comments/381046.html http://www.aygfsteel.com/yiqi/archive/2012/06/18/381046.html#Feedback 0 http://www.aygfsteel.com/yiqi/comments/commentRss/381046.html http://www.aygfsteel.com/yiqi/services/trackbacks/381046.html W一步、配|实体Bean: @Entity @Table(name = "t_bd_city") public class City extends BaseObject { /** * 省䆾 */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "fprovinceid") private Province province; } W二步、手动提交保存方法:(x)
public abstract class CoreDaoHibernate<Entity extends CoreObject> implements CoreObjectDao<Entity> {
/** * Log variable for all child classes. Uses LogFactory.getLog(getClass()) * from Commons Logging */ protected final Log log = LogFactory.getLog(getClass()); private Class<Entity> persistentClass ; private HibernateTemplate hibernateTemplate; private SessionFactory sessionFactory;
public CoreDaoHibernate(){ Class<?> c = this.getClass(); Type t = c.getGenericSuperclass(); if(t instanceof ParameterizedType){ this.persistentClass = (Class<Entity>)((ParameterizedType) t).getActualTypeArguments()[0]; } }
public HibernateTemplate getHibernateTemplate() { return this.hibernateTemplate; }
public SessionFactory getSessionFactory() { return this.sessionFactory; }
@Autowired @Required public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; this.hibernateTemplate = new HibernateTemplate(sessionFactory); }
/** * {@inheritDoc } */ @Override public Entity save(Entity object) { Entity result = hibernateTemplate.merge(object); hibernateTemplate.flush(); return result; } } W三步、配|web.xml <filter> <filter-name>lazyLoadingFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>sessionFactoryBeanName</param-name> <param-value>sessionFactory</param-value> </init-param> <init-param> <param-name>singleSession</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>flushMode</param-name> <param-value>AUTO</param-value> </init-param> </filter> <filter-mapping> <filter-name>lazyLoadingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
]]>在线创徏Oracle分区?/title> http://www.aygfsteel.com/yiqi/archive/2012/06/18/380983.html民工二代 民工二代 Mon, 18 Jun 2012 01:23:00 GMT http://www.aygfsteel.com/yiqi/archive/2012/06/18/380983.html http://www.aygfsteel.com/yiqi/comments/380983.html http://www.aygfsteel.com/yiqi/archive/2012/06/18/380983.html#Feedback 0 http://www.aygfsteel.com/yiqi/comments/commentRss/380983.html http://www.aygfsteel.com/yiqi/services/trackbacks/380983.html W一步,(g)查源表是否可以在UK定义Q? W二步、创Z张分做ؓ(f)中间表;
W三步、拷备源表中的记录;
W四步、同步更新数据;
W五步、{换完?nbsp; 阅读全文 ]]> 自己做的一个小Demo部v上线?/title> http://www.aygfsteel.com/yiqi/archive/2012/04/25/376557.html民工二代 民工二代 Wed, 25 Apr 2012 05:16:00 GMT http://www.aygfsteel.com/yiqi/archive/2012/04/25/376557.html http://www.aygfsteel.com/yiqi/comments/376557.html http://www.aygfsteel.com/yiqi/archive/2012/04/25/376557.html#Feedback 0 http://www.aygfsteel.com/yiqi/comments/commentRss/376557.html http://www.aygfsteel.com/yiqi/services/trackbacks/376557.html http://www.17chuxing.comQ实C个类似公交查询的功能Q目前基本上能够正常q行?br /> 现在ȝ一下,以便以后查询使用Q?br />一、技术方?br /> 1、demo的整体技术结构采用比较简单的Struts+spring+hibernate,struts 可以定义全局的异常、返回倹{拦截器Qhibernate采用l一的Spring-hibernate模板q行数据提交Q减开发量。如果采用hiberante懒加载方式,需要手工flush(),web.xml需要增加lazyLoadingFilter; <filter> <filter-name>lazyLoadingFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> </filter> 2、数据量较小采用?jin)mySql作ؓ(f)数据库,采用mysql需要注意的是早期的mysql版本Q表名区分大写Qa 与A的结果不一P 3、在展现层方面采用sitemesh装饰器对展现的页面进行渲染(包括样式、页头、页脚、统计代码)(j)Q保证每个网늚风格一致性,q且可以减少一定开发工作量Q?br /> <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> </filter> 4、采用gzipFilter对请求进行压~,减少每次h所需|络量Q?br /> <filter> <filter-name>gzipFilter</filter-name> <filter-class>net.sf.ehcache.constructs.web.filter.GzipFilter</filter-class> </filter> 5、首尽可能减少跌{(redirect)Q因为每ơ蟩转都需要一定的旉Q?br /> 二、部|流E?br /> 1、申请域?br /> 2、选择虚拟机托商 3、部|程?br /> 4、申请备?br /> 三、其他方面; 1、向搜烦(ch)引擎提交|站 2、其它思考点Q通过rewrite 技术实现反写,生成相应的静(rn)态文Ӟ <filter> <filter-name>rewriteFilter</filter-name> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class> <!-- sets up log level (will be logged to context log) can be: TRACE, DEBUG, INFO (default), WARN, ERROR, FATAL, log4j, commons, sysout:{level} (ie, sysout:DEBUG) if you are having trouble using normal levels use sysout:DEBUG --> <init-param> <param-name>logLevel</param-name> <param-value>commons</param-value> </init-param> <!-- set the amount of seconds the conf file will be checked for reload can be a valid integer (0 denotes check every time, -1 denotes no reload check, default -1) --> <init-param> <param-name>confReloadCheckInterval</param-name> <param-value>-1</param-value> </init-param> </filter> ]]> 通过sitemesh2装饰Jsp面Q简化开发工作?/title> http://www.aygfsteel.com/yiqi/archive/2012/03/15/371898.html民工二代 民工二代 Thu, 15 Mar 2012 01:00:00 GMT http://www.aygfsteel.com/yiqi/archive/2012/03/15/371898.html http://www.aygfsteel.com/yiqi/comments/371898.html http://www.aygfsteel.com/yiqi/archive/2012/03/15/371898.html#Feedback 0 http://www.aygfsteel.com/yiqi/comments/commentRss/371898.html http://www.aygfsteel.com/yiqi/services/trackbacks/371898.html 调试环境Qstruts,Spring,jsp W一步:(x)安装插g 在pom.xml文档中增加相应依赖:(x) <dependency> <groupId>org.sitemesh</groupId> <artifactId>sitemesh</artifactId> <version>2.4.2</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-sitemesh-plugin</artifactId> <version>2.3.1.2</version> </dependency> W二步:(x)配置监听 在web.xml文档中,增加qo(h)?br /><!-- sitemesh 装饰?--> <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> </filter> <filter-name>sitemesh</filter-name> <url-pattern>*</url-pattern> </filter-mapping> W三部:(x)配置装饰?br />在WEB-INF文g夹下Q新饰器配置文档Qdecorators.xml 文档内容如下Q?br /><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE decorators PUBLIC "-//OpenSymphony//SiteMesh 1.5 Decorators//EN" " <decorators defaultdir="/decorators"><!--文g夹可以修?-> <!-- 攑ּ装饰部分 --> <excludes> <pattern>/40*.jsp</pattern> <pattern>/*ajax=true*</pattern> <pattern>/scripts/dojo/*</pattern> <pattern>/struts/dojo/*</pattern> <pattern>/resources/*</pattern> </excludes> <!--装饰名称Q可以设|多?-> <decorator name="default" page="default.jsp"> <pattern>*</pattern> </decorator> </decorators> W四?nbsp; 在WEB-INF文g夹下Q新建sitemesh配置文档Qsitemesh.xml <sitemesh> <property name="decorators-file" value="/WEB-INF/decorators.xml"/> <excludes file="${decorators-file}"/> <page-parsers> <parser default="true" class="com.opensymphony.module.sitemesh.parser.FastPageParser"/> <parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.FastPageParser"/> <parser content-type="text/html;charset=ISO-8859-1" class="com.opensymphony.module.sitemesh.parser.FastPageParser"/> </page-parsers>
<decorator-mappers> <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper"> <param name="config" value="${decorators-file}"/> </mapper> </decorator-mappers> </sitemesh>
W五部:(x)~写装饰模板q引用标{?br />?lt;decorators defaultdir="/decorators">指定的文件下Q新加模板:(x)default.jsp
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri=" <%@ taglib uri=" <html xmlns=" <head> <%@ include file="/common/meta.jsp"%> <title><decorator:title /> | Demo</title> <decorator:head /> </head> <body <decorator:getProperty property="body.id" writeEntireProperty="true"/> <decorator:getProperty property="body.class" writeEntireProperty="true"/>> <div id="page"> <div id="header" class="clearfix"> <jsp:include page="/common/header.jsp" /> </div>
<div id="content" class="clearfix"> <div id="main"> <%@ include file="/common/messages.jsp"%> <h1> <decorator:getProperty property="meta.heading" /> </h1> <decorator:body /> </div> <c:set var="currentMenu" scope="request"> <decorator:getProperty property="meta.menu" /> </c:set> <div id="nav"> <div class="wrapper"></div> <hr /> </div> <!-- end nav --> </div> <div id="footer" class="clearfix"> <jsp:include page="/common/footer.jsp" /> </div> </div> </body> </html> W五部:(x)试 期待正确的结果?/p>
]]> 通过Spring事务理配置 http://www.aygfsteel.com/yiqi/archive/2012/03/13/371786.html民工二代 民工二代 Tue, 13 Mar 2012 02:56:00 GMT http://www.aygfsteel.com/yiqi/archive/2012/03/13/371786.html http://www.aygfsteel.com/yiqi/comments/371786.html http://www.aygfsteel.com/yiqi/archive/2012/03/13/371786.html#Feedback 0 http://www.aygfsteel.com/yiqi/comments/commentRss/371786.html http://www.aygfsteel.com/yiqi/services/trackbacks/371786.html <beans xmlns=" xmlns:xsi="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/tx
<!-- 拦截配置 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <!--说明事务cd read-only表示不支持事?propagation的事务类别与EJB保持一?-> <tx:method name="find*" read-only="true" /> <tx:method name="get*" read-only="true" /> <tx:method name="load*" read-only="true" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="insert*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> <tx:method name="delete*" propagation="REQUIRED" /> <tx:method name="*" propagation="REQUIRED" /> </tx:attributes> </tx:advice>
<!-- 切入?--> <aop:config> <!-- Dao层事?说明你要拦截那些包下面的cȝҎ(gu)--> <aop:advisor id="daoTx" advice-ref="txAdvice" pointcut="execution(* *..dao.impl.*.*(..))" order="0" /> <!-- service层事?--> <aop:advisor id="serviceTx" advice-ref="txAdvice" pointcut="execution(* *..service.impl.*.*(..))" order="1" /> </aop:config>
<!-- Enable @Transactional support --> <tx:annotation-driven /> <!-- 事务理 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> 。。。下面是具体的dataSource配置 或下载附?a href="http://www.aygfsteel.com/Files/yiqi/application-resources.rar">http://www.aygfsteel.com/Files/yiqi/application-resources.rar
]]> 使用mvn注册oracle-ojdbc http://www.aygfsteel.com/yiqi/archive/2012/03/13/371774.html民工二代 民工二代 Tue, 13 Mar 2012 01:09:00 GMT http://www.aygfsteel.com/yiqi/archive/2012/03/13/371774.html http://www.aygfsteel.com/yiqi/comments/371774.html http://www.aygfsteel.com/yiqi/archive/2012/03/13/371774.html#Feedback 0 http://www.aygfsteel.com/yiqi/comments/commentRss/371774.html http://www.aygfsteel.com/yiqi/services/trackbacks/371774.html mvn install:install-file -DgeneratePom=true -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 版本?br />-Dpackaging=jar 打包方式 -Dfile=D:\sale_workspace\sale\third_lib\ojdbc-14.jar 本地文g路径 ]]>如何正确的区分“用L(fng)例”与“系l用例”的差异 http://www.aygfsteel.com/yiqi/archive/2012/03/08/371443.html民工二代 民工二代 Thu, 08 Mar 2012 00:45:00 GMT http://www.aygfsteel.com/yiqi/archive/2012/03/08/371443.html http://www.aygfsteel.com/yiqi/comments/371443.html http://www.aygfsteel.com/yiqi/archive/2012/03/08/371443.html#Feedback 0 http://www.aygfsteel.com/yiqi/comments/commentRss/371443.html http://www.aygfsteel.com/yiqi/services/trackbacks/371443.html 昨天参与?jin)项目组的用例需求评审会(x)Q发现大家对用户用例与系l用例存在部分差异,包括架构师与需求分析师对他的理解,最后经qȝ明确如下Q?br /> 1、通过对业务流E进行梳理,得出业务程图,通过“用户用例”~写对业务流E图q行l化Q?br /> 2?#8220;用户用例”的编写主要目的:(x)用于描述业务现状Q正常情冉|怎么样做的,出现异常?jin)什么做的;不需要考虑“做什?#8221;?#8220;怎么?#8221;Q如果该业务的部分操作已l由pȝ实现Q尽可能的规避原有的pȝ操作Q以免被原来的系l框枉Ӟ说简单一点就?#8220;什么hQ在什么情况下Q做?jin)什么事Q有什么结?#8221;Q?br /> 3?#8220;pȝ用例”的编写目的:(x)主要是根?#8220;用户用例”分析得出Q要pȝ?#8220;做什?#8221;Q需要考虑有什么业务规则,但是该阶D仍然不需要考虑怎么做;“pȝ用例”需要考虑做事要遵循哪些业务规则,提前告知应用设计师,设计时要考虑哪些问题Q如何处理异常流E; ]]> 从架构角度,思考如何优化系l性能Q?/title> http://www.aygfsteel.com/yiqi/archive/2012/02/29/370983.html民工二代 民工二代 Wed, 29 Feb 2012 05:29:00 GMT http://www.aygfsteel.com/yiqi/archive/2012/02/29/370983.html http://www.aygfsteel.com/yiqi/comments/370983.html http://www.aygfsteel.com/yiqi/archive/2012/02/29/370983.html#Feedback 0 http://www.aygfsteel.com/yiqi/comments/commentRss/370983.html http://www.aygfsteel.com/yiqi/services/trackbacks/370983.html
pȝ优化从架构层面,可以考虑从以下方面进行思考:(x)
一、结? 1、业务需求方? 与用h通确认,自己对业务理解是否存在误区,用户对业务响应的期望本n没有那么高Q? 2、品选型
应该反思我们在选择产品斚w是否存在~陷QY件的设计初衷׃你的希望不一_(d)q要需要考虑产品是否支持定w、集、横向扩展等
阅读全文 ]]> myBatis 实现模糊匚w http://www.aygfsteel.com/yiqi/archive/2012/02/25/370762.html民工二代 民工二代 Sat, 25 Feb 2012 03:24:00 GMT http://www.aygfsteel.com/yiqi/archive/2012/02/25/370762.html http://www.aygfsteel.com/yiqi/comments/370762.html http://www.aygfsteel.com/yiqi/archive/2012/02/25/370762.html#Feedback 0 http://www.aygfsteel.com/yiqi/comments/commentRss/370762.html http://www.aygfsteel.com/yiqi/services/trackbacks/370762.html <select id="query" parameterType="Province" resultMap="provinceMap"> <![CDATA[ select fid,fname,fnumber,fsimpleName,fdescription,fcreateTime,flastUpdateTime,fdirect from t_yp_province where fname like '%'|| #{name} || '%' ]]> </select> ]]> Hibernate日期cd使用注意 http://www.aygfsteel.com/yiqi/archive/2012/02/22/370532.html民工二代 民工二代 Wed, 22 Feb 2012 09:34:00 GMT http://www.aygfsteel.com/yiqi/archive/2012/02/22/370532.html http://www.aygfsteel.com/yiqi/comments/370532.html http://www.aygfsteel.com/yiqi/archive/2012/02/22/370532.html#Feedback 0 http://www.aygfsteel.com/yiqi/comments/commentRss/370532.html http://www.aygfsteel.com/yiqi/services/trackbacks/370532.html 我们在?Hibernate scalar ?hibernatecd Hibernate.DATE获取的数据只包含q月日不包含时分U数据,卛_?2010-01-15 Q?/font>所以一定要Ҏ(gu) Hibernate.TIMESTAMP Q然后在前台q行格式化?/font> ]]>
վ֩ģ壺
ȫ |
|
ũ |
|
Ƽ |
|
|
|
|
|
ʢ |
Ҿ |
|
ٲ |
ʹ |
º |
|
ԭ |
|
ɽ |
ţ |
Ϫ |
|
|
Ϫ |
|
|
|
Զ |
|
|
|
¡ |
|
|
|
|
³ |
|
ˮ |
Զ |