2016-06-12 11 views
0

私は、リポジトリと呼ばれるインタフェースの中で宣言されているメソッドにアドバイスするためのポイントカットを持っています。しかし、ランタイムでは、そのアスペクトは適用されません。私のpointcutに何が間違っていますか?ここで次のSpringのPointCutで何が問題になりますか?

はポイントカットである: -

@Around("execution (* *..Repository+.save*(..))" + " && args(entity,..) && target(target)") 
    public Object cacheEvictOnSaveSingle(ProceedingJoinPoint proceedingJoinPoint, Region entity, 
      RegionRepositoryCassandraImpl target) { 
} 

とリポジトリのインターフェイスは次のようである: -

public interface Repository<ENTITY extends Entity<IDENTITY>, IDENTITY extends Serializable, DATAOBJECT> { 

    /** 
    * Find. 
    * 
    * @param id the id 
    * @return the t 
    */ 
    public ENTITY find(IDENTITY id); 

    /** 
    * Save. 
    * 
    * @param entity the entity 
    */ 
    public void save(ENTITY entity); 

    /** 
    * Save async. 
    * 
    * @param entity the entity 
    * @return the result set future 
    */ 
    public ResultSetFuture saveAsync(ENTITY entity); 

    /** 
    * Save. 
    * 
    * @param entity the entity 
    * @param batchStatement the batch statement 
    */ 
    public void save(ENTITY entity, BatchStatement batchStatement); 

    /** 
    * Save. 
    * 
    * @param entities the entities 
    */ 
    public void save(List<ENTITY> entities); 

    /** 
    * Save async. 
    * 
    * @param entities the entities 
    * @return the result set future 
    */ 
    public ResultSetFuture saveAsync(List<ENTITY> entities); 

    /** 
    * Save. 
    * 
    * @param entities the entities 
    * @param batchStatement the batch statement 
    */ 
    public void save(List<ENTITY> entities, BatchStatement batchStatement); 

    /** 
    * Delete. 
    * 
    * @param id the id 
    */ 
    public void delete(IDENTITY id); 

    /** 
    * Delete async. 
    * 
    * @param id the id 
    * @return the result set future 
    */ 
    public ResultSetFuture deleteAsync(IDENTITY id); 

    /** 
    * Delete. 
    * 
    * @param id the id 
    * @param batchStatement the batch statement 
    */ 
    public void delete(IDENTITY id, BatchStatement batchStatement); 

    /** 
    * Delete. 
    * 
    * @param ids the ids 
    */ 
    public void delete(List<IDENTITY> ids); 

    /** 
    * Delete async. 
    * 
    * @param ids the ids 
    * @return the result set future 
    */ 
    public ResultSetFuture deleteAsync(List<IDENTITY> ids); 

    /** 
    * Delete. 
    * 
    * @param ids the ids 
    * @param batchStatement the batch statement 
    */ 
    public void delete(List<IDENTITY> ids, BatchStatement batchStatement); 

} 

これは次のように抽象クラス内で実装されています -

@Override 
    public void save(ENTITY entity) { 
     BatchStatement batchStatement = new BatchStatement(); 
     addEntityToSaveBatch(batchStatement, entity); 

     session.execute(batchStatement); 
    } 

    /* (non-Javadoc) 
    * @see com.byteobject.cloudsanthe.dbclient.repository.Repository#saveAsync(com.byteobject.cloudsanthe.dbclient.dto.compute.Entity) 
    */ 
    @Override 
    public ResultSetFuture saveAsync(ENTITY entity) { 
     BatchStatement batchStatement = new BatchStatement(); 
     addEntityToSaveBatch(batchStatement, entity); 

     return session.executeAsync(batchStatement); 
    } 

    /* (non-Javadoc) 
    * @see com.byteobject.cloudsanthe.dbclient.repository.Repository#save(com.byteobject.cloudsanthe.dbclient.dto.compute.Entity, com.datastax.driver.core.BatchStatement) 
    */ 
    @Override 
    public void save(ENTITY entity, BatchStatement batchStatement) { 
     addEntityToSaveBatch(batchStatement, entity); 
    } 

ことができますあなたは私がこれを解決するのを助ける?

@Around("execution (* *..Repository+.save*(..))" + " && args(entity,..) && target(target)") 
public Object cacheEvictOnSaveSingle(
    ProceedingJoinPoint proceedingJoinPoint, 
    Entity<UUID> entity, 
    RegionRepositoryCassandraImpl target 
) { 
    // ... 
} 
+0

私のクラスには、前述した抽象クラスが拡張: - - : –

+0

Spring AOPでCGLIBまたはJDKベースのプロキシを使用していますか? –

答えて

0

私は、それがあるべきメソッドのシグネチャでミスをしたパブリッククラスRegionRepositoryCassandraImplは<、RegionDO地域、UUID> \t \t実装EntityRepositoryを拡張RegionRepository {
関連する問題