`
文章列表
b]Introduction[/b] AOP(面向且面的编程),是对传统的OOP的有力补充。 OOP中的核心部分是类。AOP中核心的部分是切面。 AOP是对IOC的有力补充。提供了许多声明式的企业服务。事务管理是最重要的一种服务。 AOP运行用户自定义切面,用切面去补充面向对象的编程。 AOP支持仅方法执行连接点。如果要执行属性执行或是修改可以考虑使用 AspectJ。 Spring的AOP是想提供一种AOP实现和IOC的整合以解决大部分企业应用中的问题。 AOP Proxy Spring默认使用j2se的动态代理作为spring的aop代理。这使得任意一个接口都可以被代理。 spring也可以 ...
1.hiberante,将部分查询字段值封装成自定义的bean List<MyBean> users = this.hibernateTemplate.find("select new MyBean(usename, password) from JBAUser u where u.username='" + jbaUser.getUsername() + "'");          for(JBAUser user : users) {        System.out.println(user.getUsername());   ...
1.配置文件转换成对应的注解形式 <bean id="exampleBean" factory-bean="serviceLocator" factory-method="createInstance"/> 在 @Confiuration 的类直接使用 @Bean... @Confiugration public class AppConfig{ @Bean Instance yourInstance(){ return InstanceFactory.createInstance(); } } 2.Spri ...
OGNL部分 Object Graph Navigation Language(对象图导航语言) 处理OGNL的最顶层的对象是一个map。通常被引用为context map 或是context。 这个context默认有一个根对象。在表达式中,可对象的属性可以不使用任何标记被引用。使用其他对象需要使用#符号。 OGNL context被设置为ActionContext中。值栈被作为OGNL的跟对象。值栈是一系列对象的集合,但是对于OGNL,就相当于一个对象。 结构如下:     |                      |--application                      ...
/** * JDBC工具类 */ public class JdbcUtils { private static final Logger logger = Logger.getLogger(JdbcUtils.class);//这种情况下默认使用logger打印,如是只打印到自定义的logger就获取自定义的logger的名称          //这里使用的是c3p0数据源 privat ...
注解是一种元数据(描述数据的数据),本身并不具备任何功能,spring中除了基于xml配置IOC。还有另外一种实现就是使用注解配合BeanPostProcessor来实现。BeanPostProcessor是对注解进行处理bean。 spring2.0中强制属性是必须的使用的是@required,在spring2.5中也可以这样使用。而spring2.5还提供了@Autowired来实现同样的功能。并且可以更细粒度的控制和更宽适用行。 Spring也支持 JSR-250 开发的注释,如@Resource, @PostConstruct等。 当然使用注解jdk的版本必须是5.0或以上的版本。 使用 ...
对表字段操作 1.修改字段 alter table tableName [alter column columnName columnType[column constraint]] 2.添加字段 alter table tableName add column columnName columnType[column constraint] 3.删除字段 alter table tableName drop column columnName JDBC部分 JDBC定义了java与数据库的编程接口。 与jdbc相关的类主要在java.sql.*中。 常见的数据库的JDBC的加载 //Sql S ...
infrastructure  基础 Typically  通常 straightforward 简单易懂的 Composing  组合 leading slash 前倒斜杠 dependency 依赖的 qualified  合格的 coupling  链接 preferable 可取的 indirection 间接的 e.g. 例如 placeholders  占位符 qualified 限定 collaborators  引用 Explained  解释 essentially  本质上 recipe 方法 encapsulated 被包围的 mandatory  强制的 ...
Spring事物提供的好处: 1.Provides a consistent programming model across different transaction APIs such as JTA, JDBC, Hibernate, JPA, and JDO 根据不同的事物API,如JTA,JDBC,Hibernate,JPA,JDO,提供了一致的编程模式。 2.Supports declarative transaction management   支持声明式事物管理 3.Provides a simpler API for programmatic transaction mana ...
简单shell函数定义 #!/bin/bash /*此行是shell脚本必须包含的部分,表示用哪个进行解析,这里是bash */ #hellofun  /* 此行表示注释,shell脚本中注释使用#,放到第二行表示该脚本的名称*/ function hello(){   echo "Hello,today is `date`" /* 'da ...
实现多线程的两种方式:继承Thread类或是实现Runnable接口,推荐后者 线程所拥有的状态:初始状态,可运行状态,运行状态,阻塞状态,锁池状态,等待队列,终止状态。 线程的生命状态: 1.当线程类被创建后就进入初始化状态 ...
关键元素介绍 1.Annotation Type Target(@Target)   注释类型 Target Indicates the kinds of program element to which an annotation type is applicable. If a Target meta-annotation is not present on an annotation type declaration, the declared type may be used on any program element. If such a m ...

Shell

shell是介于操作系统和使用者之间的接口。 对用户而言可以屏蔽系统的负责性。 对于系统而言可以防止用户的误操作或是有意的破坏。 使用较广的shell有标准的Bourne shell (sh)、Korn Shell(ksh)、C shell (csh)、Bourne Again Shell(bash)等。 ...
应用程序缓存包括:对象缓存、查询缓存、页面缓存 页面缓存包括:动态页面静态化、servlet缓存、页面内部缓存 对象缓存 由hibernate框架提供,细粒度的缓存数据库的查询结果,无需手动编码实现,(也可以不实用hibernate,而是自己实现对象缓存如将查询出的对象放入hashMap中等),是最省事的缓存策略,使用对象缓存会极大的降低web系统对数据库的访问量。 对象缓存适合联机事务处理(OLTP) 对象缓存分为:对表记录的entity对象缓存、对1n关系集合的缓存、对n对1关系关联对象的缓存。 hibernate对象缓存的配置 @Entity @Cache(usage = CacheCo ...
此文转载 linux解压 tar命令 tar命令 tar [-cxtzjvfpPN] 文件与目录 .... 参数: -c :建立一个压缩文件的参数指令(create 的意思); -x :解开一个压缩文件的参数指令! -t :查看 tarfile 里面的文件! 特别注意,在参数的下达中, c/x/t ...
Global site tag (gtag.js) - Google Analytics