@Override public Void inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { entitySqlDaoWrapperFactory.become(TagSqlDao.class).create(modelDao, internalCallContext); return null; } });
@Override public List<TagModelDao> inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { final TagSqlDao tagSqlDao = entitySqlDaoWrapperFactory.become(TagSqlDao.class); if (includedDeleted) { return tagSqlDao.getByAccountRecordIdIncludedDeleted(internalTenantContext); } else { return tagSqlDao.getByAccountRecordId(internalTenantContext); } } });
@Override public TagModelDao inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { return entitySqlDaoWrapperFactory.become(TagSqlDao.class).getById(id.toString(), internalCallContext); } });
@Override public List<TagModelDao> inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { final TagSqlDao tagSqlDao = entitySqlDaoWrapperFactory.become(TagSqlDao.class); if (includedDeleted) { return tagSqlDao.getTagsForObjectIncludedDeleted(objectId, objectType, internalTenantContext); } else { return tagSqlDao.getTagsForObject(objectId, objectType, internalTenantContext); } } });
@Override public Void inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { final TagDefinitionModelDao tagDefinition = getTagDefinitionFromTransaction(tagDefinitionId, entitySqlDaoWrapperFactory, context); final TagSqlDao transactional = entitySqlDaoWrapperFactory.become(TagSqlDao.class); final List<TagModelDao> tags = transactional.getTagsForObject(objectId, objectType, context); TagModelDao tag = null; for (final TagModelDao cur : tags) { if (cur.getTagDefinitionId().equals(tagDefinitionId)) { tag = cur; break; } } if (tag == null) { throw new TagApiException(ErrorCode.TAG_DOES_NOT_EXIST, tagDefinition.getName()); } // Delete the tag transactional.markTagAsDeleted(tag.getId().toString(), context); postBusEventFromTransaction(tag, tag, ChangeType.DELETE, entitySqlDaoWrapperFactory, context); return null; } });
@Override public Iterator<TagModelDao> build(final TagSqlDao tagSqlDao, final Long offset, final Long limit, final Ordering ordering, final InternalTenantContext context) { return tagSqlDao.search(searchKey, String.format("%%%s%%", searchKey), offset, limit, ordering.toString(), context); } },
@Override public Long inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { return entitySqlDaoWrapperFactory.become(TagSqlDao.class).getRecordId(tagId.toString(), internalCallContext); } });
@Override public Long getCount(final TagSqlDao tagSqlDao, final InternalTenantContext context) { return tagSqlDao.getSearchCount(searchKey, String.format("%%%s%%", searchKey), context); }
@Override public List<TagModelDao> inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { final TagSqlDao tagSqlDao = entitySqlDaoWrapperFactory.become(TagSqlDao.class); if (includedDeleted) { return tagSqlDao.getTagsForObjectIncludedDeleted(objectId, objectType, internalTenantContext); } else { return tagSqlDao.getTagsForObject(objectId, objectType, internalTenantContext); } } });
@Override public Void inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { final TagDefinitionModelDao tagDefinition = getTagDefinitionFromTransaction(tagDefinitionId, entitySqlDaoWrapperFactory, context); final TagSqlDao transactional = entitySqlDaoWrapperFactory.become(TagSqlDao.class); final List<TagModelDao> tags = transactional.getTagsForObject(objectId, objectType, context); TagModelDao tag = null; for (final TagModelDao cur : tags) { if (cur.getTagDefinitionId().equals(tagDefinitionId)) { tag = cur; break; } } if (tag == null) { throw new TagApiException(ErrorCode.TAG_DOES_NOT_EXIST, tagDefinition.getName()); } // Delete the tag transactional.markTagAsDeleted(tag.getId().toString(), context); postBusEventFromTransaction(tag, tag, ChangeType.DELETE, entitySqlDaoWrapperFactory, context); return null; } });
@Override public Iterator<TagModelDao> build(final TagSqlDao tagSqlDao, final Long offset, final Long limit, final Ordering ordering, final InternalTenantContext context) { return tagSqlDao.search(searchKey, String.format("%%%s%%", searchKey), offset, limit, ordering.toString(), context); } },
@Override public Long inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { return entitySqlDaoWrapperFactory.become(TagSqlDao.class).getRecordId(tagId.toString(), internalCallContext); } });
@Override public Long getCount(final TagSqlDao tagSqlDao, final InternalTenantContext context) { return tagSqlDao.getSearchCount(searchKey, String.format("%%%s%%", searchKey), context); }
@Override public List<TagModelDao> inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { final TagSqlDao tagSqlDao = entitySqlDaoWrapperFactory.become(TagSqlDao.class); if (includedDeleted) { return tagSqlDao.getByAccountRecordIdIncludedDeleted(internalTenantContext); } else { return tagSqlDao.getByAccountRecordId(internalTenantContext); } } });
@Override public Void inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { entitySqlDaoWrapperFactory.become(TagSqlDao.class).create(modelDao, internalCallContext); return null; } });
@Override public TagModelDao inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) throws Exception { return entitySqlDaoWrapperFactory.become(TagSqlDao.class).getById(id.toString(), internalCallContext); } });