Package com.tll.model.key

Examples of com.tll.model.key.NameKey


      final String name = search.getName();
      final IEntityService<IEntity> svc = getEntityService(et);
      if(svc instanceof INamedEntityService == false) {
        throw new RuntimeException("Entity type: " + et + "doesn't support loading by name.");
      }
      final IEntity e = ((INamedEntityService) svc).load(new NameKey(ec, name));
      // final Model m = marshal(et, e);
      // payload.setModel(m);
      status.addMsg(e.descriptor() + " loaded.", MsgLevel.INFO, MsgAttr.STATUS.flag);
      return e;
    }
View Full Code Here


    // retrieve by name key if applicable..
    if(INamedEntity.class.isAssignableFrom(entityHandler.entityClass())) {
      logger.debug("Perfoming actual find by name dao test..");
      final Class<?> nec = entityHandler.entityClass();
      final String name = ((INamedEntity) e).getName();
      final NameKey<INamedEntity> nk = new NameKey(nec, name);
      startNewTransaction();
      try {
        e = dao.load(nk);
        // NOTE: as there may be other like enties having the same name, we only
        // test when we know there is no ambiguity
View Full Code Here

      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

Related Classes of com.tll.model.key.NameKey

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.