Examples of CouchEntity


Examples of com.couchace.core.api.annotation.CouchEntity

    public <T> EntityMeta<T> buildEntityMeta(Class<T> entityClass) {
        List<AttachmentMeta> localAttachmentList = new ArrayList<>();

        // Look for class level annotations.
        CouchEntity couchEntity = ClassUtil.findClassAnnotation(entityClass, CouchEntity.class);
        if (couchEntity == null) {
            throw CouchException.internalServerError("Class " + entityClass.getName() + " does not have required @CouchEntity annotation.");
        }
        String entityType;
        if (StringUtil.isNotBlank(couchEntity.value())) {
            entityType = couchEntity.value();
        } else {
            entityType = entityClass.getSimpleName();
        }

        // Look for method level annotations.
View Full Code Here

Examples of ru.dreamteam.couch.CouchEntity

    private CouchEntity couchEntity1;

    @Before
    public void setUp() {
        comparator = HasIdComparator.INSTANCE;
        couchEntity1 = new CouchEntity();
        couchEntity1.setId("1");
    }
View Full Code Here

Examples of ru.dreamteam.couch.CouchEntity

        Assert.assertEquals(0, comparator.compare(couchEntity1, couchEntity1));
    }

    @Test
    public void testDiff() throws Exception {
        CouchEntity couchEntity2 = new CouchEntity();
        couchEntity2.setId("2");
        Assert.assertTrue(comparator.compare(couchEntity1, couchEntity2) < 0);
        Assert.assertTrue(comparator.compare(couchEntity2, couchEntity1) > 0);
    }
View Full Code Here

Examples of ru.dreamteam.couch.CouchEntity

        Assert.assertTrue(comparator.compare(couchEntity2, couchEntity1) > 0);
    }

    @Test
    public void testOneIdNull() throws Exception {
        CouchEntity couchEntity2 = new CouchEntity();
        Assert.assertTrue(comparator.compare(couchEntity1, couchEntity2) > 0);
        Assert.assertTrue(comparator.compare(couchEntity2, couchEntity1) < 0);
    }
View Full Code Here

Examples of ru.dreamteam.couch.CouchEntity

        assertNotNull(changes);
    }

    @Test
    public void testDocChanges() throws Exception {
        CouchEntity entity = new CouchEntity();
        db.save(entity);

        List<Change> changes = query.limit(1).descending(true).list();
        assertEquals(1, changes.size());
        assertEquals(entity.getId(), changes.get(0).getId());
        assertEquals(entity.getRevision(), changes.get(0).getRev());
    }
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.