mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	DAO constructor should be lightweight to make Spring DI faster.
This commit is contained in:
		
							parent
							
								
									1ba6740fc1
								
							
						
					
					
						commit
						e9300d2676
					
				@ -18,6 +18,7 @@ package org.apache.cloudstack.affinity.dao;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.PostConstruct;
 | 
			
		||||
import javax.ejb.Local;
 | 
			
		||||
import org.apache.cloudstack.affinity.AffinityGroupVO;
 | 
			
		||||
import org.springframework.stereotype.Component;
 | 
			
		||||
@ -33,7 +34,12 @@ public class AffinityGroupDaoImpl extends GenericDaoBase<AffinityGroupVO, Long>
 | 
			
		||||
    private SearchBuilder<AffinityGroupVO> AccountIdNamesSearch;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    protected AffinityGroupDaoImpl() {
 | 
			
		||||
    public AffinityGroupDaoImpl() {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostConstruct
 | 
			
		||||
    protected void init() {
 | 
			
		||||
        AccountIdSearch = createSearchBuilder();
 | 
			
		||||
        AccountIdSearch.and("accountId", AccountIdSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
 | 
			
		||||
        AccountIdSearch.done();
 | 
			
		||||
 | 
			
		||||
@ -18,6 +18,7 @@ package org.apache.cloudstack.affinity.dao;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.PostConstruct;
 | 
			
		||||
import javax.ejb.Local;
 | 
			
		||||
import javax.inject.Inject;
 | 
			
		||||
 | 
			
		||||
@ -50,7 +51,11 @@ public class AffinityGroupVMMapDaoImpl extends GenericDaoBase<AffinityGroupVMMap
 | 
			
		||||
    @Inject
 | 
			
		||||
    protected AffinityGroupDao _affinityGroupDao;
 | 
			
		||||
 | 
			
		||||
    protected AffinityGroupVMMapDaoImpl() {
 | 
			
		||||
    public AffinityGroupVMMapDaoImpl() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostConstruct
 | 
			
		||||
    protected void init() {
 | 
			
		||||
        ListVmIdByAffinityGroup = createSearchBuilder(Long.class);
 | 
			
		||||
        ListVmIdByAffinityGroup.and("affinityGroupId", ListVmIdByAffinityGroup.entity().getAffinityGroupId(),
 | 
			
		||||
                SearchCriteria.Op.EQ);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user