Package com.tll.model.test

Examples of com.tll.model.test.EntityGraph


      @Inject
      IEntityGraphPopulator builder;

      @Override
      public EntityGraph get() {
        final EntityGraph graph = new EntityGraph();
        builder.setEntityGraph(graph);
        // builder.populateEntityGraph();
        return graph;
      }
    }).asEagerSingleton();
View Full Code Here


  private boolean doStub(ObjectContainer dbSession) {
    assert dbSession != null;
    try {
      if(populator == null) throw new IllegalStateException("No populator set");
      populator.populateEntityGraph();
      final EntityGraph eg = populator.getEntityGraph();
      final Iterator<Class<? extends IEntity>> itr = eg.getEntityTypes();
      while(itr.hasNext()) {
        final Class<? extends IEntity> et = itr.next();
        log.info("Storing entities of type: " + et.getSimpleName() + "...");
        final Collection<? extends IEntity> ec = eg.getEntitiesByType(et);
        for(final IEntity e : ec) {
          log.info("Storing entity: " + et + "...");
          dbSession.store(e);
        }
      }
View Full Code Here

   * @throws Exception Upon failure
   */
  public void testCircularEntity() throws Exception {
    final TestPersistenceUnitEntityGraphBuilder entityGraphBuilder =
      new TestPersistenceUnitEntityGraphBuilder(getEntityBeanFactory());
    final EntityGraph entityGraph = new EntityGraph();
    entityGraphBuilder.setEntityGraph(entityGraph);
    entityGraphBuilder.populateEntityGraph();
    final Marshaler marshaler = getMarshaler();

    // wire up a circular entity
    final Collection<Account> accounts = entityGraph.getEntitiesByType(Account.class);
    // NOTE: we expect 3 of them per test-persistence-unit jar
    final Iterator<Account> aitr = accounts.iterator();
    final Account account = aitr.next(), parent = aitr.next();
    account.setParent(parent);
    parent.setParent(account);
View Full Code Here

TOP

Related Classes of com.tll.model.test.EntityGraph

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.