use of org.thingsboard.server.dao.model.nosql.CustomerEntity in project thingsboard by thingsboard.
the class CassandraCustomerDao method findCustomersByTenantIdAndTitle.
@Override
public Optional<Customer> findCustomersByTenantIdAndTitle(UUID tenantId, String title) {
Select select = select().from(CUSTOMER_BY_TENANT_AND_TITLE_VIEW_NAME);
Select.Where query = select.where();
query.and(eq(CUSTOMER_TENANT_ID_PROPERTY, tenantId));
query.and(eq(CUSTOMER_TITLE_PROPERTY, title));
CustomerEntity customerEntity = findOneByStatement(query);
Customer customer = DaoUtil.getData(customerEntity);
return Optional.ofNullable(customer);
}
Aggregations