Project

General

Profile

feature request #7861

TaxonGraphHibernateListener: inject the ITaxonGraphDao into TaxonGraphBeforeTransactionCompleteProcess

Added by Andreas Kohlbecker 12 months ago. Updated 8 months ago.

Status:
New
Priority:
New
Category:
cdmlib
Target version:
Start date:
10/24/2018
Due date:
% Done:

0%

Severity:
normal

Description

we could think about refactoring the TaxonGraphHibernateListener a bit:

Andreas Müller suggested to inject the ITaxonGraphDao into TaxonGraphBeforeTransactionCompleteProcess which could be done by passing it as cunstrucor parameter of the TaxonGraphBeforeTransactionCompleteProcess. Here some example code snippets of a spring configuration class setting up the TaxonGraphHibernateListener:

@Configuration
@CdmHibernateListener // enable the configuration which activates the TaxonGraphHibernateListener bean
public class MyConfiguration {

    @Autowired
    @Qualifier("runAsAuthenticationProvider")
    private AuthenticationProvider runAsAuthenticationProvider;

    @Autowired
    private ITaxonGraphHibernateListener taxonGraphHibernateListener;


    @Autowired
    private ITaxonGraphDao taxonGraphDao;

    @Bean
    public MyBean myBean() {
     taxonGraphHibernateListener.registerProcessClass(
        TaxonGraphBeforeTransactionCompleteProcess.class, 
        new Object[]{new RunAsAdmin(runAsAuthenticationProvider), taxonGraphDao}, 
        new Class[]{IRunAs.class, ITaxonGraphDao.class});
    }

}

The constructor of the TaxonGraphBeforeTransactionCompleteProcess would need to be adapted for this to work.
The main benefit of this excercise is that we could get rid of the AbstractHibernateTaxonGraphProcessor which currently is the common base class for the dao and the TaxonGraphBeforeTransactionCompleteProcess.

copied from #7648#note-17


Related issues

Copied from Edit - feature request #7648: Create taxonrelation to genus or species when subordinate names are created Resolved 08/13/2018

History

#1 Updated by Andreas Kohlbecker 12 months ago

  • Copied from feature request #7648: Create taxonrelation to genus or species when subordinate names are created added

#2 Updated by Andreas Kohlbecker 12 months ago

  • Tracker changed from bug to feature request

#3 Updated by Andreas Kohlbecker 9 months ago

  • Target version changed from Release 5.5 to Release 5.6

#4 Updated by Andreas Kohlbecker 8 months ago

  • Target version changed from Release 5.6 to Unassigned CDM tickets

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)