Package com.saasovation.common.port.adapter.persistence.leveldb

Examples of com.saasovation.common.port.adapter.persistence.leveldb.LevelDBUnitOfWork


    @Override
    public void removeAll(Collection<Release> aReleaseCollection) {
        boolean locked = false;

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        for (Release release : aReleaseCollection) {
            if (!locked) {
                LevelDBKey lockKey = new LevelDBKey(PRIMARY, release.tenantId().id());

                uow.lock(lockKey.key());

                locked = true;
            }

            this.remove(release, uow);
View Full Code Here


    @Override
    public void save(Release aRelease) {
        LevelDBKey lockKey = new LevelDBKey(PRIMARY, aRelease.tenantId().id());

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        uow.lock(lockKey.key());

        this.save(aRelease, uow);
    }
View Full Code Here

    @Override
    public void saveAll(Collection<Release> aReleaseCollection) {
        boolean locked = false;

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        for (Release release : aReleaseCollection) {
            if (!locked) {
                LevelDBKey lockKey = new LevelDBKey(PRIMARY, release.tenantId().id());

                uow.lock(lockKey.key());

                locked = true;
            }

            this.save(release, uow);
View Full Code Here

    public Collection<ProductOwner> allProductOwnersOfTenant(TenantId aTenantId) {
        List<ProductOwner> productOwners = new ArrayList<ProductOwner>();

        LevelDBKey productOwnersOfTenant = new LevelDBKey(PRODUCT_OWNER_OF_TENANT, aTenantId.id());

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.readOnly(this.database());

        List<Object> keys = uow.readKeys(productOwnersOfTenant);

        for (Object productOwnerId : keys) {
            ProductOwner productOwner = uow.readObject(productOwnerId.toString().getBytes(), ProductOwner.class);

            if (productOwner != null) {
                productOwners.add(productOwner);
            }
        }
View Full Code Here

    @Override
    public void remove(ProductOwner aProductOwner) {
        LevelDBKey lockKey = new LevelDBKey(PRIMARY, aProductOwner.tenantId().id());

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        uow.lock(lockKey.key());

        this.remove(aProductOwner, uow);
    }
View Full Code Here

    @Override
    public void removeAll(Collection<ProductOwner> aProductOwnerCollection) {
        boolean locked = false;

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        for (ProductOwner productOwner : aProductOwnerCollection) {
            if (!locked) {
                LevelDBKey lockKey = new LevelDBKey(PRIMARY, productOwner.tenantId().id());

                uow.lock(lockKey.key());

                locked = true;
            }

            this.remove(productOwner, uow);
View Full Code Here

    @Override
    public void save(ProductOwner aProductOwner) {
        LevelDBKey lockKey = new LevelDBKey(PRIMARY, aProductOwner.tenantId().id());

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        uow.lock(lockKey.key());

        this.save(aProductOwner, uow);
    }
View Full Code Here

    @Override
    public void saveAll(Collection<ProductOwner> aProductOwnerCollection) {
        boolean locked = false;

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        for (ProductOwner productOwner : aProductOwnerCollection) {
            if (!locked) {
                LevelDBKey lockKey = new LevelDBKey(PRIMARY, productOwner.tenantId().id());

                uow.lock(lockKey.key());

                locked = true;
            }

            this.save(productOwner, uow);
View Full Code Here

TOP

Related Classes of com.saasovation.common.port.adapter.persistence.leveldb.LevelDBUnitOfWork

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.