Package org.springframework.aop

Examples of org.springframework.aop.TargetSource


     * il faut récupérer la target du proxy
     */
    public void testRepositorySendTargetedObjectToTheMapperWhenAddingOrUpdating() {
       
        // récupération de l'object target du proxy
        TargetSource targetSource = ((Advised) basicProject).getTargetSource();       
        Object target = ((SingletonTargetSource) targetSource).getTarget();
        Project basicProjectTarget = (Project) target;
       
        expect(mockBasicProjectProxyUtil.getTarget(basicProject)).andReturn(basicProjectTarget);
        mockBasicProjectMapper.addOrUpdate(basicProjectTarget);
View Full Code Here


     * @return basicProject target
     */
    private BasicProject getTarget(Object basicProject) {
       
      // BasicProject est un proxy, il faut r�cup�rer la target
        TargetSource targetSource = ((Advised) basicProject).getTargetSource();       
        Object target = ((SingletonTargetSource) targetSource).getTarget();

        // retour de la target
        return (BasicProject) target;
       
View Full Code Here

        // de la base
        // ATTENTION : l'object doit exister en base !!!! Sinon exception hibernate. Donc l'Id doit �tre > � 0
        if (returnValue == null && ((BasicProject) invocation.getThis()).getId() > 0 ) {
           
            // BasicProject est un proxy, il faut r�cup�rer la target
            TargetSource targetSource = ((Advised) ((BasicProject) invocation.getThis())).getTargetSource();       
            Object target = ((SingletonTargetSource) targetSource).getTarget();
           
            returnValue = domainListMapper.findCollectionForObject((BasicProject) target);
            // la valeur de retour est donn�e � l'object
            ((BasicProject) invocation.getThis()).setMembers((Set) returnValue);
View Full Code Here

       user.setPersistanceVersion(2);

       basicProject.getMembers().add(user);
      
       // Project is a proxy, so we need to get the target
       TargetSource targetSource = ((Advised) basicProject).getTargetSource();       
       Object target = ((SingletonTargetSource) targetSource).getTarget();
      
       // add
       basicProjectMapper.addOrUpdate((Project) target);
      
View Full Code Here

        basicProject1.setName("mega project");
       
        basicProject2.setCode("FFGT2");
        basicProject2.setName("mega project");
       
        TargetSource targetSource1 = ((Advised) basicProject1).getTargetSource();       
        Object target1 = ((SingletonTargetSource) targetSource1).getTarget();
       
        TargetSource targetSource2 = ((Advised) basicProject2).getTargetSource();       
        Object target2 = ((SingletonTargetSource) targetSource2).getTarget();
       
       
        //add
        basicProjectMapper.addOrUpdate((Project) target1);
View Full Code Here

        basicProject.setCode("PR1");
        basicProject.setName("super PM Project");
        basicProject.setPersistanceVersion(1);
       
        // Project is a proxy, so we need to get the target
        TargetSource targetSource = ((Advised) basicProject).getTargetSource();       
        Object target = ((SingletonTargetSource) targetSource).getTarget();
       
        // update
        basicProjectMapper.addOrUpdate((Project) target);
       
View Full Code Here

        basicProject2.setPersistanceId(1);
        basicProject2.setCode("PR1");
        basicProject2.setName("super mega PM Project");
        basicProject2.setPersistanceVersion(1);

        TargetSource targetSource1 = ((Advised) basicProject1).getTargetSource();       
        Object target1 = ((SingletonTargetSource) targetSource1).getTarget();
       
        TargetSource targetSource2 = ((Advised) basicProject2).getTargetSource();       
        Object target2 = ((SingletonTargetSource) targetSource2).getTarget();
       
        // update
        basicProjectMapper.addOrUpdate((Project) target1);
       
View Full Code Here

        basicProject.setCode("PR1");
        basicProject.setName("PM Project");
        basicProject.setPersistanceVersion(1);
       
        // Project is a proxy, so we need to get the target
        TargetSource targetSource = ((Advised) basicProject).getTargetSource();       
        Object target = ((SingletonTargetSource) targetSource).getTarget();
       
        basicProjectMapper.delete((Project) target);
       
        // check
View Full Code Here

        basicProject2.setCode("PR1");
        basicProject2.setName("PM Project");
        basicProject2.setPersistanceVersion(1);

        // Project is a proxy, so we need to get the target
        TargetSource targetSource1 = ((Advised) basicProject1).getTargetSource();       
        Object target1 = ((SingletonTargetSource) targetSource1).getTarget();
       
        TargetSource targetSource2 = ((Advised) basicProject2).getTargetSource();       
        Object target2 = ((SingletonTargetSource) targetSource2).getTarget();
       
        basicProjectMapper.delete((Project) target1);
       
        try {
View Full Code Here

      basicProject.setCode("PR2");
      basicProject.setName("PM Project 2");
      basicProject.setPersistanceVersion(2);
     
      // Project is a proxy, so we need to get the target
        TargetSource targetSource = ((Advised) basicProject).getTargetSource();       
        Object target = ((SingletonTargetSource) targetSource).getTarget();
     
      // appel de la m�thode
      Collection collection = userMapper.findCollectionForObject((Project) target);
     
View Full Code Here

TOP

Related Classes of org.springframework.aop.TargetSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.