在进入主题之前,你必须对Spring 的AOP有1定的认识了解,本文还援用到1定的反射机制,请1并学之哦,谢谢大家支持!
首先,在构建好ssh框架后,我们先声明用来记录日志的实体类Log,代码以下:
package com.smartsoft.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name = ""Log"")
public class Log extends BaseModel {
@Id
@GenericGenerator(name = "idGenerator", strategy = "uuid")
@GeneratedValue(generator = "idGenerator")
@Column(name = ""id"", unique = true)
private String id;
/* 用
------分隔线----------------------------
------分隔线----------------------------