自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 资源 (2)
  • 收藏
  • 关注

原创 hibernate 乐观锁&悲观锁

hibernate乐观锁 就是在数据库中增加一个字段例如version 每一次修改数据的时候,都会修改version的值,所以,同时修改数据的时候并不会成功,同时会抛出一个org.hibernate.StaleObjectStateException异常。这个时候可以捕获这个异常然后,重新修改值,就可以了。 示例:@Entity@Table(name = "t_user")public c

2017-03-16 20:06:33 256

原创 hibernate service

hibernate service中跟dao并无太大区别。 写了一个简单的BaseServicepublic interface IBaseService<DAO extends IBaseDao<T>, T> { public void save(T t); public T getById(Long id); public void update(T t); p

2017-03-14 20:16:24 579

原创 spring&hibernate(01-简单构建)

pom.xml<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId></dependency><dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId></depe

2017-03-13 20:20:33 310

原创 一个简单的基于spring jdbc的扩展

今天试了一下用spring的jdbcTemplate来增删改查的功能,感觉还是挺麻烦的,于是就扩展了一下,代码比较凌乱,见谅。 原来的UserDao:@Resourceprivate JdbcTemplate jdbcTemplate;@Overridepublic void save(User t) { if(t == null) return ; this.jdbcTemp

2017-03-12 22:01:22 407

原创 spring jdbc之query

直接上代码public class User { private Long id; private String username; private String password;beans.xml<context:property-placeholder location="classpath:settings.properties" /><!-- 查看对应的配置 -->

2017-03-12 12:06:36 578

原创 aop with annotation

@Aspectpublic class AopMethod { @Pointcut("execution(* com.xxx.spring.aop.service.SomeServiceWithNoInterface.*(..))") public void pointCut() { } public void before() { System.o

2017-03-11 09:27:13 284

原创 spring aop xml实例

pom.xml<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId></dependency><dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId></depe

2017-03-11 09:07:34 250

原创 spring bean创建

spring bean 方法1:<bean id="stu1" class="aa.xxx.chapter01.Student"> <constructor-arg index="0" value="1"/> <constructor-arg index="1" value="小明"/></bean><bean id="stu2" class="aa.xxx.chapter01

2017-03-10 09:39:47 287

原创 spring基础说明01-schema

一个简单的配置<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://w

2017-03-09 12:41:09 313

转载 文章标题

idea创建Maven项目慢的问题解决方法:settings->Build, Ex...->Build Tools->Maven->Runner-DarchetypeCatalog=internal

2017-03-09 09:16:08 187

原创 坚持

从今天开始,坚持每天一个博客

2017-03-09 09:10:46 202

一个简单的spring-jdbctemplate扩展

一个简单的spring的jdbcTemplate扩展

2017-03-12

spring创建bean简单示例

spring创建bean简单示例

2017-03-10

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除