Package er.neo4jadaptor.test.eo

Examples of er.neo4jadaptor.test.eo.ThirdEntity


  public void test15_queryingEOObjectsByToOneRelationships() {
    FirstEntity row1a = ERXEOControlUtilities.createAndInsertObject(ec, FirstEntity.class);
    @SuppressWarnings("unused")
    FirstEntity row1b = ERXEOControlUtilities.createAndInsertObject(ec, FirstEntity.class);
    SecondEntity row2 = ERXEOControlUtilities.createAndInsertObject(ec, SecondEntity.class);
    ThirdEntity row3 = ERXEOControlUtilities.createAndInsertObject(ec, ThirdEntity.class);
//    NSArray<FirstEntity> results;
    NSArray<ThirdEntity> results3;
   
    row1a.setSecondEntityRelationship(row2);
    row2.setThirdEntityRelationship(row3);
    row3.setFirstEntityRelationship(row1a);
   
    ec.saveChanges();
    ec.invalidateAllObjects();

    results3 = fetch(ThirdEntity.ENTITY_NAME, ERXQ.equals(path(ThirdEntity.FIRST_ENTITY_KEY, FirstEntity.SECOND_ENTITY_KEY), row2));
View Full Code Here


  }
 
  public void test24_flattenedKeyPathAccess() {
    FirstEntity first = ERXEOControlUtilities.createAndInsertObject(ec, FirstEntity.class);
    SecondEntity second = ERXEOControlUtilities.createAndInsertObject(ec, SecondEntity.class);
    ThirdEntity third = ERXEOControlUtilities.createAndInsertObject(ec, ThirdEntity.class);
    Join join = ERXEOControlUtilities.createAndInsertObject(ec, Join.class);
    NSArray<?> results;
   
    join.setFirstEntityRelationship(first);
    join.setSecondEntityRelationship(second);
 
    first.setSecondEntityRelationship(second);
    second.setThirdEntityRelationship(third);
    third.setFirstEntityRelationship(first);
   
    // add some fake objects
    ERXEOControlUtilities.createAndInsertObject(ec, FirstEntity.class);
    ERXEOControlUtilities.createAndInsertObject(ec, SecondEntity.class);
    ERXEOControlUtilities.createAndInsertObject(ec, ThirdEntity.class);
View Full Code Here

   
    FirstEntity f3 = ERXEOControlUtilities.createAndInsertObject(ec, FirstEntity.class);
   
    j2.setFirstEntityRelationship(f3);
   
    ThirdEntity t4 = ERXEOControlUtilities.createAndInsertObject(ec, ThirdEntity.class);
   
    t4.setFirstEntityRelationship(f3);
   
    ec.saveChanges();
    ec.invalidateAllObjects();
   
    // basic stuff, not using any flattened relationship
    assertEquals(1, t4.firstEntity().joins().get(0).secondEntity().firstEntities().size());
   
    assertEquals(1, t4.firstEntity().joins_secondEntity().size());
    assertEquals(1, t4.firstEntity().joins_secondEntity_firstEntities().size());
   
    // problematic parts
    assertEquals(1, t4.firstEntity_joins().size());
    assertEquals(1, t4.firstEntity_joins_secondEntity().size());
    assertEquals(1, t4.firstEntity_joins_secondEntity_firstEntities().size());
   
  }
View Full Code Here

TOP

Related Classes of er.neo4jadaptor.test.eo.ThirdEntity

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.