コード例 #1
0
 internal virtual void DeleteAllIndexRules()
 {
     foreach (IndexDefinition index in Db.schema().Indexes)
     {
         if (!index.ConstraintIndex)
         {
             index.Drop();
         }
     }
 }
コード例 #2
0
 private void CreateIndex(Label label, string key)
 {
     using (Transaction tx = _db.beginTx())
     {
         _db.schema().indexFor(label).on(key).create();
         tx.Success();
     }
     using (Transaction tx = _db.beginTx())
     {
         _db.schema().awaitIndexesOnline(10, SECONDS);
         tx.Success();
     }
 }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldRecoverCreationOfUniquenessConstraintFollowedByDeletionOfThatSameConstraint() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldRecoverCreationOfUniquenessConstraintFollowedByDeletionOfThatSameConstraint()
        {
            // given
            CreateUniqueConstraint();
            DropConstraints();

            // when - perform recovery
            Restart(Snapshot(StoreDir.absolutePath()));

            // then - just make sure the constraint is gone
            using (Transaction tx = _db.beginTx())
            {
                assertFalse(_db.schema().getConstraints(_label).GetEnumerator().hasNext());
                tx.Success();
            }
        }
コード例 #4
0
 private void CreatePropertyIndex()
 {
     using (Transaction tx = _graphDb.beginTx())
     {
         _graphDb.schema().indexFor(Label).on(PROP_NAME).create();
         tx.Success();
     }
 }
コード例 #5
0
ファイル: DatabaseRule.cs プロジェクト: Neo4Net/Neo4Net
 public override Schema Schema()
 {
     return(GraphDatabaseAPI.schema());
 }