If you want to make unique field with barcode, productid, facilityid you need to do the following in entity.
Just give an index name and set unique= true.
<index name=”FIXEDASSET_UNQBARCD” unique=”true”>
<index-field name=”barCodeNumber”/>
<index-field name=”instanceOfProductId”/>
<index-field name=”facilityId”/>
</index>
<index-field name=”barCodeNumber”/>
<index-field name=”instanceOfProductId”/>
<index-field name=”facilityId”/>
</index>
N.B: It does not work in derby database.