Package org.structr.core.entity

Examples of org.structr.core.entity.SixOneOneToOne


    try {

      final TestOne testOne  = createTestNode(TestOne.class);
      final TestSix testSix  = createTestNode(TestSix.class);
      SixOneOneToOne rel     = null;

      assertNotNull(testOne);
      assertNotNull(testSix);

      try (final Tx tx = app.tx()) {

        rel = app.create(testSix, testOne, SixOneOneToOne.class);
        tx.success();
      }

      assertNotNull(rel);

      try {
        // try to delete relationship
        rel.getRelationship().delete();

        fail("Should have raised an org.neo4j.graphdb.NotInTransactionException");
      } catch (org.neo4j.graphdb.NotInTransactionException e) {}

      // Relationship still there
      assertNotNull(rel);

      try (final Tx tx = app.tx()) {

        app.delete(rel);
        tx.success();
      }

      try (final Tx tx = app.tx()) {

        String uuid = rel.getUuid();
        fail("Deleted entity should have thrown an exception on access.");

      } catch (IllegalStateException iex) {
      }
View Full Code Here


    try {

      final TestSix testSix = this.createTestNode(TestSix.class);
      final TestOne testOne = this.createTestNode(TestOne.class);
      SixOneOneToOne rel            = null;

      assertNotNull(testSix);
      assertNotNull(testOne);
     
      try (final Tx tx = app.tx()) {
       
        rel = app.create(testSix, testOne, SixOneOneToOne.class);
        tx.success();
      }

      assertNotNull(rel);

      GraphDatabaseService graphDb      = graphDbCommand.execute();
      ExecutionEngine engine            = (ExecutionEngine) new ExecutionEngine(graphDb);
     
      try (final Tx tx = app.tx()) {
       
        ExecutionResult result            = engine.execute("start n = node(*) match (n)<-[r:ONE_TO_ONE]-() return r");
        final Iterator<Relationship> rels = result.columnAs("r");

        assertTrue(rels.hasNext());

        rels.next().delete();
       
        tx.success();
      }

      try (final Tx tx = app.tx()) {
       
        String uuid = rel.getUuid();
        assertNull("UUID of deleted relationship should be null", uuid);
      } catch (IllegalStateException iex) {
      }

    } catch (FrameworkException ex) {
View Full Code Here

    try {

      final TestOne testOne  = createTestNode(TestOne.class);
      final TestSix testSix  = createTestNode(TestSix.class);
      SixOneOneToOne rel     = null;

      assertNotNull(testOne);
      assertNotNull(testSix);

      try (final Tx tx = app.tx()) {
       
        rel = app.create(testSix, testOne, SixOneOneToOne.class);
        tx.success();
      }

      assertNotNull(rel);

      try (final Tx tx = app.tx()) {
       
        testOne.getRelationships().iterator().next().getRelationship().delete();
        tx.success();
      }

      try (final Tx tx = app.tx()) {
       
        String uuid = rel.getUuid();
        assertNull("UUID of deleted relationship should be null", uuid);
      } catch (IllegalStateException iex) {
       
      }
View Full Code Here

    try {

      final TestOne testOne  = createTestNode(TestOne.class);
      final TestSix testSix  = createTestNode(TestSix.class);
      SixOneOneToOne rel     = null;

      assertNotNull(testOne);
      assertNotNull(testSix);

      try (final Tx tx = app.tx()) {
       
        rel = app.create(testSix, testOne, SixOneOneToOne.class);
        tx.success();
      }

      assertNotNull(rel);

      try (final Tx tx = app.tx()) {
       
        GraphObject  searchRes = app.get(testSix.getUuid());
        assertNotNull(searchRes);
      }
     
      try (final Tx tx = app.tx()) {
       
        testSix.getRelationships().iterator().next().getRelationship().delete();

        tx.success();
      }

      try (final Tx tx = app.tx()) {
       
        String uuid = rel.getUuid();
        assertNull("UUID of deleted relationship should be null", uuid);
      } catch (IllegalStateException iex) {
       
      }
View Full Code Here

TOP

Related Classes of org.structr.core.entity.SixOneOneToOne

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.