public final class TLfnProductRepository extends Object
Repository to query the products available in LuciadFusion Studio.
LuciadFusion will create an implementation of the TLfnProductRepository
at startup and provide this as a bean in the Spring container.
Spring dependency injection can be used to obtain a reference to the repository in your code.
The most straightforward way is to use the org.springframework.beans.factory.annotation.Autowired
annotation in the constructor of your Spring component.
@Controller
public class MyController {
private final TLfnProductRepository fProductRepository;
@Autowired
public MyController(TLfnProductRepository aProductRepository) {
fProductRepository = aProductRepository;
}
}
TLfnProduct
Modifier and Type | Method and Description |
---|---|
List<TLfnProduct> |
findByServiceId(String aServiceId)
Searches for the products published in the service with the given id.
|
Optional<TLfnProduct> |
findByServiceIdAndProductName(String aServiceId,
String aProductName)
Searches for a product with the given name that is published in the service with the given id.
|
public List<TLfnProduct> findByServiceId(String aServiceId)
aServiceId
is null
, an empty list is returned.aServiceId
- the id of the service to search published products forpublic Optional<TLfnProduct> findByServiceIdAndProductName(String aServiceId, String aProductName)
aServiceId
- the id of the service that contains the productaProductName
- the name of the productOptional
containing the product, Optional.empty()
if none is found.