- 博客(2)
- 资源 (3)
- 收藏
- 关注
转载 @Entity陷阱
<br />在@Entity时很容易顺手导入@org.hibernate.annotations.Entity这个包,结果导致了异常。其实应该导入的是@javax.persistence.Entity <br /><br />Always import @javax.persistence.Entity <br />@org.hibernate.annotations.Entity是@javax.persistence.Entity的一个补充,但不是后者的替代品 <br /><br />如果import @
2011-04-19 17:05:00 331
原创 java动态代理
<br />动态代理的实现步骤:<br />1.创建一个实现接口InvocationHandler的类,它必须实现invoke方法<br />2.创建被代理的类以及接口<br />3.通过Proxy的静态方法<br />newProxyInstance(ClassLoader loader, Class[] interfaces, InvocationHandler h) 创建一个代理<br />ClassLoader loader是类加载器, h是实现了InvocationHandler接口的一个实例<b
2011-04-07 21:46:00 256
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人