use of org.thingsboard.server.dao.model.nosql.AssetEntity in project thingsboard by thingsboard.
the class CassandraAssetDao method findAssetsByTenantIdAndName.
@Override
public Optional<Asset> findAssetsByTenantIdAndName(UUID tenantId, String assetName) {
Select select = select().from(ASSET_BY_TENANT_AND_NAME_VIEW_NAME);
Select.Where query = select.where();
query.and(eq(ASSET_TENANT_ID_PROPERTY, tenantId));
query.and(eq(ASSET_NAME_PROPERTY, assetName));
AssetEntity assetEntity = (AssetEntity) findOneByStatement(query);
return Optional.ofNullable(DaoUtil.getData(assetEntity));
}
Aggregations