1.先创建以DAO层接口
package cn.ouyang.test.entity;
//DAO层接口
public interface Student {
}
2.为之前接口写实现类
package cn.ouyang.test.entity;
public class StudentImpl implements Student {
@Override
@Override
}
3.写代理类:(动态代理):
package cn.ouyang.test.entity;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
public class Inction implements InvocationHandler {
@Override
}
4.写测试类:
package cn.ouyang.test.test;
import cn.ouyang.test.entity.Inction;
import cn.ouyang.test.entity.Student;
import cn.ouyang.test.entity.StudentImpl;
public class Test {
}