Examples of EntityMetadata


Examples of com.sleepycat.persist.model.EntityMetadata

    public synchronized void closeClass(Class entityClass)
        throws DatabaseException {

        checkOpen();
        String clsName = entityClass.getName();
        EntityMetadata entityMeta = checkEntityClass(clsName);

        PrimaryIndex priIndex = priIndexMap.get(clsName);
        if (priIndex != null) {
            /* Close the secondaries first. */
            DatabaseException firstException = null;
            for (SecondaryKeyMetadata keyMeta :
                 entityMeta.getSecondaryKeys().values()) {

                String secName = makeSecName(clsName, keyMeta.getKeyName());
                SecondaryIndex secIndex = secIndexMap.get(secName);
                if (secIndex != null) {
                    Database db = secIndex.getDatabase();
View Full Code Here

Examples of com.sleepycat.persist.model.EntityMetadata

    }

    public synchronized DatabaseConfig getPrimaryConfig(Class entityClass) {
        checkOpen();
        String clsName = entityClass.getName();
        EntityMetadata meta = checkEntityClass(clsName);
        return getPrimaryConfig(meta).cloneConfig();
    }
View Full Code Here

Examples of com.splunk.EntityMetadata

    EntityKids(Entity entity) {
        this.entity = entity;
    }

    @Override protected void addNotify() {
        EntityMetadata metadata = entity.getMetadata();
        if (metadata == null) return;
        setKeys(new EntityMetadata[] { metadata });
    }
View Full Code Here

Examples of com.tll.model.EntityMetadata

   */
  @SuppressWarnings("unchecked")
  public static <E extends IEntity> void makeBusinessKeyUnique(E e) {
    IBusinessKeyDefinition<E>[] bkdefs;
    try {
      BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
      bkdefs = bkf.definitions((Class<E>) e.entityClass());
    }
    catch(final BusinessKeyNotDefinedException ex) {
      // ok
      return;
View Full Code Here

Examples of com.tll.model.EntityMetadata

    if(e2 instanceof ITimeStampEntity) {
      ((ITimeStampEntity) e2).setDateCreated(((ITimeStampEntity) e2).getDateCreated());
      ((ITimeStampEntity) e2).setDateModified(((ITimeStampEntity) e2).getDateModified());
    }
    try {
      BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
      bkf.apply(e2, bkf.create(e1));
    }
    catch(final BusinessKeyNotDefinedException e) {
      // assume ok
    }
View Full Code Here

Examples of com.tll.model.EntityMetadata

  @SuppressWarnings("unchecked")
  protected <E extends IEntity> E getTestEntity() throws Exception {
    logger.debug("Creating test entity..");
    final E e = (E) getEntityBeanFactory().getEntityCopy(entityHandler.entityClass());
    entityHandler.assembleTestEntity(e);
    BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
    if(bkf.hasBusinessKeys(entityHandler.entityClass())) {
      entityHandler.makeUnique(e);
    }
    testEntityRefStack.add(new PkAndType(e.entityClass(), e.getId()));
    logger.debug("Test entity created: " + e);
View Full Code Here

Examples of com.tll.model.EntityMetadata

   * @throws Exception
   */
  final void daoDuplicationException() throws Exception {
    // IMPT: don't test run this dao test if there are no business keys defined
    // for the current entity type!!
    BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
    if(!bkf.hasBusinessKeys(entityHandler.entityClass())) {
      return;
    }

    IEntity e = getTestEntity();
View Full Code Here

Examples of com.tll.model.EntityMetadata

    Assert.assertEquals(re, e);
  }

  final void daoFindEntityByBusinessKeyCriteria() throws Exception {
    try {
      BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
      final IBusinessKeyDefinition<IEntity>[] bkdefs = bkf.definitions(entityHandler.entityClass());

      // persist the target test entity
      IEntity e = getTestEntity();
      e = dao.persist(e);
View Full Code Here

Examples of com.tll.model.EntityMetadata

  public <E extends IEntity> E load(final IBusinessKey<E> key) throws EntityNotFoundException, DataAccessException {
    return loadByPredicate(new Predicate<E>(key.getType()) {

      @Override
      public boolean match(E candidate) {
        BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
        return bkf.equals(candidate, key);
      }
    }, key);
  }
View Full Code Here

Examples of com.tll.model.EntityMetadata

  @Transactional(readOnly = true)
  @Override
  public AccountInterface loadAccountInterface(Long accountKey, Long interfaceKey) {
    IBusinessKey<InterfaceOptionAccount> bk;
    try {
      BusinessKeyFactory bkf = new BusinessKeyFactory(new EntityMetadata());
      bk = bkf.create(InterfaceOptionAccount.class, "Option Id and Account Id");
    }
    catch(final BusinessKeyNotDefinedException e) {
      throw new IllegalStateException(e);
    }
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.