摘要:
@Autowired是Spring提供的一种注入Bean的方法。具体的应用是: 1)在Service类中定义的注入属性前加@Autowired。例如:@Autowired private PersonDAO personDAO, 2)必须有个set方法,例如:@Autowired public void setPersonDAO(PersonDAO personDAO) { System.out.println("********** @Autowired注入Bean *************"); this.personDAO = personDAO; }Spring配 阅读全文
posted @ 2014-01-04 15:31
sheroHuo
阅读(328)
评论(0)
推荐(0)
摘要:
1、struts2 spring hibernate几个重要的注解annotation(1)表示将action交给Spring管理@Component == @Component("testAction") @Component@Scope("prototype")2、数据库中的常用注解:(1),@entity(name="tablename") 类注解@entity 默认的entityname就是类名 告诉hibernate 我这个类需要和数据库对应 对应的数据库表名为tablename(2),@Id 属性注解指明该属性是主键(3) 阅读全文
posted @ 2014-01-04 11:03
sheroHuo
阅读(250)
评论(0)
推荐(0)
浙公网安备 33010602011771号