Search in sources :

Example 1 with PropertyKeyTokenCommand

use of org.neo4j.kernel.impl.transaction.command.Command.PropertyKeyTokenCommand in project neo4j by neo4j.

the class Commands method createPropertyKeyToken.

public static PropertyKeyTokenCommand createPropertyKeyToken(int id, int nameId) {
    PropertyKeyTokenRecord before = new PropertyKeyTokenRecord(id);
    PropertyKeyTokenRecord after = new PropertyKeyTokenRecord(id);
    populateTokenRecord(after, nameId);
    return new PropertyKeyTokenCommand(before, after);
}
Also used : PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) PropertyKeyTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.PropertyKeyTokenCommand)

Example 2 with PropertyKeyTokenCommand

use of org.neo4j.kernel.impl.transaction.command.Command.PropertyKeyTokenCommand in project neo4j by neo4j.

the class NeoStoreTransactionApplierTest method shouldApplyPropertyKeyTokenCommandToTheStore.

// PROPERTY KEY TOKEN COMMAND
@Test
public void shouldApplyPropertyKeyTokenCommandToTheStore() throws Exception {
    // given
    final BatchTransactionApplier applier = newApplier(false);
    final PropertyKeyTokenRecord before = new PropertyKeyTokenRecord(42);
    final PropertyKeyTokenRecord after = new PropertyKeyTokenRecord(42);
    after.setInUse(true);
    after.setNameId(323);
    final Command command = new PropertyKeyTokenCommand(before, after);
    // when
    boolean result = apply(applier, command::handle, transactionToApply);
    // then
    assertFalse(result);
    verify(propertyKeyTokenStore, times(1)).updateRecord(after);
}
Also used : RelationshipTypeTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.RelationshipTypeTokenCommand) LabelTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.LabelTokenCommand) PropertyKeyTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.PropertyKeyTokenCommand) BatchTransactionApplier(org.neo4j.kernel.impl.api.BatchTransactionApplier) PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) PropertyKeyTokenCommand(org.neo4j.kernel.impl.transaction.command.Command.PropertyKeyTokenCommand) Test(org.junit.Test)

Aggregations

PropertyKeyTokenRecord (org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord)2 PropertyKeyTokenCommand (org.neo4j.kernel.impl.transaction.command.Command.PropertyKeyTokenCommand)2 Test (org.junit.Test)1 BatchTransactionApplier (org.neo4j.kernel.impl.api.BatchTransactionApplier)1 LabelTokenCommand (org.neo4j.kernel.impl.transaction.command.Command.LabelTokenCommand)1 RelationshipTypeTokenCommand (org.neo4j.kernel.impl.transaction.command.Command.RelationshipTypeTokenCommand)1