Zend certified PHP/Magento developer

Magento2: How to check record before save record in table?

I am adding the barcode with product SKU and product ID in a table using below code:-

File Path: /app/code/[NameSpace]/[ModuleName]/Model/ResourceModel/Custom.php

public function generateBarcodes($object, $attribute, $barcode, $_product)
    {

        $objectManager = MagentoFrameworkAppObjectManager::getInstance();
        $barcodeModel = $objectManager->create('VendorModuleModelBarcode');

        $data = array(
            'barcode' => $barcode,
            'product_id' => $_product->getId(),
            'qty' => 1,
            'product_sku' => $_product->getSku(),
            'supplier_code' => '',
            'history_id' => 0000
        );      

        $barcodeModel->setData($data);
        $barcodeModel->save(); 
    }

but I want to stop duplicate record in table, Please let me know how to achieve this in above code.

My table structure:-
enter image description here