Examples of INamedEntity


Examples of com.tll.model.INamedEntity

  @SuppressWarnings({
    "unchecked", "rawtypes" })
  final void daoFindEntityByName() throws Exception {
    if(INamedEntity.class.isAssignableFrom(entityHandler.entityClass())) {
      // persist the target test entity
      INamedEntity e = getTestEntity();
      e = dao.persist(e);
      getDbTrans().setComplete();
      getDbTrans().endTrans();

      getDbTrans().startTrans();
      final Criteria<IEntity> c = new Criteria<IEntity>(entityHandler.entityClass());
      c.getPrimaryGroup().addCriterion(
          new NameKey(e.entityClass(), e.getName(), entityHandler.getActualNameProperty()), true);
      final IEntity re = dao.findEntity(c);
      Assert.assertTrue(re != null);
      if(re != null) Assert.assertEquals(re, e);
    }
  }
View Full Code Here

Examples of com.tll.model.INamedEntity

  @SuppressWarnings("unchecked")
  final void daoFindEntityByName() throws Exception {
    if(INamedEntity.class.isAssignableFrom(entityHandler.entityClass())) {
      // persist the target test entity
      INamedEntity e = getTestEntity();
      e = dao.persist(e);
      setComplete();
      endTransaction();

      startNewTransaction();
      final Criteria<IEntity> c = new Criteria<IEntity>(entityHandler.entityClass());
      c.getPrimaryGroup().addCriterion(new NameKey(e.entityClass(), e.getName()), true);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.