@ SuppressWarnings ( { "OverlyLongMethod" } ) public void clearProperties ( @ NotNull final PersistentStoreTransaction txn , @ NotNull final Entity entity ) { final Transaction envTxn = txn . getEnvironmentTransaction ( ) ; final PersistentEntityId id = ( PersistentEntityId ) entity . getId ( ) ; final int entityTypeId = id . getTypeId ( ) ; final long entityLocalId = id . getLocalId ( ) ; final PropertiesTable properties = getPropertiesTable ( txn , entityTypeId ) ; final PropertyKey propertyKey = new PropertyKey ( entityLocalId , 0 ) ; try ( Cursor cursor = getPrimaryPropertyIndexCursor ( txn , properties ) ) { for ( boolean success = cursor . getSearchKeyRange ( PropertyKey . propertyKeyToEntry ( propertyKey ) ) != null ; success ; success = cursor . getNext ( ) ) { ByteIterable keyEntry = cursor . getKey ( ) ; final PropertyKey key = PropertyKey . entryToPropertyKey ( keyEntry ) ; if ( key . getEntityLocalId ( ) != entityLocalId ) { break ; } final int propertyId = key . getPropertyId ( ) ; final ByteIterable value = cursor . getValue ( ) ; final PropertyValue propValue = propertyTypes . entryToPropertyValue ( value ) ; txn . propertyChanged ( id , propertyId , propValue . getData ( ) , null ) ; properties . deleteNoFail ( txn , entityLocalId , value , propertyId , propValue . getType ( ) ) ; } } }
Clears all properties of specified entity .