package com.ecep.contract.converter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; import com.ecep.contract.service.CompanyService; import com.ecep.contract.vo.CompanyVo; import jakarta.annotation.PostConstruct; @Lazy @Component public class CompanyStringConverter extends EntityStringConverter { @Lazy @Autowired CompanyService service; public CompanyStringConverter() { } @PostConstruct private void init() { setInitialized(project -> service.findById(project.getId())); setSuggestion(service::search); setFromString(service::findByName); } }