hi guys i want to use the spring aop set the pointcut on the method of the hibernate pojo entity. but it unsuccess. (my two class name are user and userAction) my idea is that in the method showuser() of the userAction it execute user.getName() the spring aop intercept the getName(). my pointcut define like this: @Pointcut("execution(* com.hibernate.table..*.get*(..))") private void checkHibernateEntityMethod() { } who can help me ? how to do? thanks for your answers. package com.hibernate.table.entity; @Entity @Table(name = "USER") public class User implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Column(name = "name", length = 255, unique = true, nullable = false) private String name; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } ) public class UserAction extends AbstractAction { @Resource private UserService userservice; private Integer id; public Integer getId(){ return this.id; } public void setId(Integer id){ this.id=id; } public void showuser() throws JSONException { User user = userservice.queryuserbyId(getId()); if(null!=user) user.getName(); } }
|