@Override public RelationshipType getType() { spi.assertInUnterminatedTransaction(); return spi.getRelationshipTypeById( typeId() ); }
@Override public boolean isType( RelationshipType type ) { spi.assertInUnterminatedTransaction(); return spi.getRelationshipTypeById( typeId() ).name().equals( type.name() ); }
@Override public String toString() { String relType; try { relType = spi.getRelationshipTypeById( typeId() ).name(); return format( "(%d)-[%s,%d]->(%d)", sourceId(), relType, getId(), targetId() ); } catch ( NotInTransactionException | DatabaseShutdownException e ) { // We don't keep the rel-name lookup if the database is shut down. Source ID and target ID also requires // database access in a transaction. However, failing on toString would be uncomfortably evil, so we fall // back to noting the relationship type id. } relType = "RELTYPE(" + type + ")"; return format( "(?)-[%s,%d]->(?)", relType, getId() ); }
@Override public RelationshipType getType() { spi.assertInUnterminatedTransaction(); return spi.getRelationshipTypeById( typeId() ); }
@Override public boolean isType( RelationshipType type ) { spi.assertInUnterminatedTransaction(); return spi.getRelationshipTypeById( typeId() ).name().equals( type.name() ); }
@Override public String toString() { String relType; try { relType = spi.getRelationshipTypeById( typeId() ).name(); return format( "(%d)-[%s,%d]->(%d)", sourceId(), relType, getId(), targetId() ); } catch ( NotInTransactionException | DatabaseShutdownException e ) { // We don't keep the rel-name lookup if the database is shut down. Source ID and target ID also requires // database access in a transaction. However, failing on toString would be uncomfortably evil, so we fall // back to noting the relationship type id. } relType = "RELTYPE(" + type + ")"; return format( "(?)-[%s,%d]->(?)", relType, getId() ); }