Examples of DomainObject


Examples of com.inspiresoftware.lib.dto.geda.test.DomainObject

    public void entityToDtoAndBackToEntityVoidByFilter(Object target, Object source, Object extra) {
        swapDtoValues(target);
    }

    private void swapEntityValues(final Object targetE) {
        final DomainObject entity = (DomainObject) targetE;
        final String temp = entity.getValue2();
        entity.setValue2(entity.getValue());
        entity.setValue(temp);
        entity.setTimestamp(new Date(System.currentTimeMillis() + 1000L));
    }
View Full Code Here

Examples of net.sf.pmr.keopsframework.domain.object.DomainObject

        // date
        calendar.set(Calendar.MILLISECOND, calendar.get(Calendar.MILLISECOND) + 1);
        Date date = calendar.getTime();
       
        DomainObject mockDomainObject1 = EasyMock.createMock(DomainObject.class);
        DomainObject mockDomainObject2 = EasyMock.createMock(DomainObject.class);

        temporalDomainMap.putVersion(date, mockDomainObject1);
       
        temporalDomainMap.putVersion(date, mockDomainObject2);
       
View Full Code Here

Examples of net.sf.pmr.keopsframework.domain.object.DomainObject

        //date
        calendar.set(Calendar.MILLISECOND, calendar.get(Calendar.MILLISECOND) + 1);
        Date date = calendar.getTime();
       
        // domainOject
        DomainObject mockDomainObject = EasyMock.createMock(DomainObject.class);
       
        temporalDomainMap.putVersion(date,mockDomainObject);
       
        assertEquals("putVersion", 2, temporalDomainMap.getMap().size());
       
View Full Code Here

Examples of net.sf.pmr.keopsframework.domain.object.DomainObject

        calendar.set(Calendar.MILLISECOND, calendar.get(Calendar.MILLISECOND) + 1);
       
        Date date = calendar.getTime();
       
        DomainObject mockDomainObject = EasyMock.createMock(DomainObject.class);
       
        temporalDomainMap.putVersion(date, mockDomainObject);
       
        assertEquals("getLatest", mockDomainObject, temporalDomainMap.getLatest());
        assertEquals("getMapSize", 2, temporalDomainMap.getMap().size());
View Full Code Here

Examples of net.sf.pmr.keopsframework.domain.object.DomainObject

        Date date1 = calendar.getTime();
       
        calendar.set(Calendar.MILLISECOND, calendar.get(Calendar.MILLISECOND) + 1);
        Date date2 = calendar.getTime();
       
        DomainObject mockDomainObject1 = EasyMock.createMock(DomainObject.class);
        DomainObject mockDomainObject2 = EasyMock.createMock(DomainObject.class);
       
        temporalDomainMap.putVersion(date1, mockDomainObject1);
        temporalDomainMap.putVersion(date2, mockDomainObject2);
       
        assertEquals("getLatest", mockDomainObject2, temporalDomainMap.getLatest());
View Full Code Here

Examples of net.sf.pmr.keopsframework.domain.object.DomainObject

        Date date2 = calendar.getTime();

        calendar.set(Calendar.MILLISECOND, calendar.get(Calendar.MILLISECOND) + 1);
        Date date3 = calendar.getTime();
       
        DomainObject mockDomainObject1 = EasyMock.createMock(DomainObject.class);
        DomainObject mockDomainObject2 = EasyMock.createMock(DomainObject.class);
        DomainObject mockDomainObject3 = EasyMock.createMock(DomainObject.class);
       
        temporalDomainMap.putVersion(date1, mockDomainObject1);
        temporalDomainMap.putVersion(date2, mockDomainObject2);
        temporalDomainMap.putVersion(date3, mockDomainObject3);
       
View Full Code Here

Examples of org.apache.openjpa.persistence.query.DomainObject

        qb = (QueryBuilderImpl)emf.getDynamicQueryBuilder();
        emf.createEntityManager();
    }
   
    public void testLogicalPredicateAssociativity() {
        DomainObject e = qb.createQueryDefinition(Employee.class);
        Predicate p1 = e.get("salary").greaterThan(100);
        Predicate p2 = e.get("rating").equal(5);
        Predicate p3 = e.get("name").like("John");
        Predicate w1 = p1.and(p2.or(p3));
        Predicate w2 = (p1.and(p2)).or(p3);
        QueryDefinition q1 = e.select(e).where(w1);
        String jpql1 = qb.toJPQL(q1);
        emf.createEntityManager().createDynamicQuery(q1).getResultList();
       
        QueryDefinition q2 = e.select(e).where(w2);
        String jpql2 = qb.toJPQL(q2);
        System.err.println(jpql1);
        System.err.println(jpql2);
        assertNotEquals(jpql1, jpql2);
        emf.createEntityManager().createDynamicQuery(q2).getResultList();
View Full Code Here

Examples of org.apache.openjpa.persistence.query.DomainObject

        assertNotEquals(jpql1, jpql2);
        emf.createEntityManager().createDynamicQuery(q2).getResultList();
    }
   
    public void testMultipleDomainOfSameClass() {
        DomainObject o1 = qb.createQueryDefinition(Order.class);
        DomainObject o2 = o1.addRoot(Order.class);
        o1.select(o1)
          .where(o1.get("quantity").greaterThan(o2.get("quantity"))
            .and(o2.get("customer").get("lastName").equal("Smith"))
            .and(o2.get("customer").get("firstName").equal("John")));
       
        String jpql = "select o from Order o, Order o2" +
                      " where o.quantity > o2.quantity" +
                      " and o2.customer.lastName = 'Smith'" +
                      " and o2.customer.firstName = 'John'";
View Full Code Here

Examples of org.apache.openjpa.persistence.query.DomainObject

                      " and o2.customer.firstName = 'John'";
        compare(jpql, o1);
    }

    public void testFetchJoin() {
        DomainObject d = qb.createQueryDefinition(Department.class);
        d.leftJoinFetch("employees");
        d.where(d.get("deptNo").equal(1));
       
       
        String jpql = "select d from Department d" +
                      " LEFT JOIN FETCH d.employees" +
                      " where d.deptNo = 1";
View Full Code Here

Examples of org.apache.openjpa.persistence.query.DomainObject

                      " where d.deptNo = 1";
        compare(jpql, d);
    }
   
    public void testMultipartNavigation() {
        DomainObject e = qb.createQueryDefinition(Employee.class);
        DomainObject p = e.join("contactInfo").join("phones");
        e.where(e.get("contactInfo").get("address").get("zipCode")
                .equal("95094")).select(p.get("vendor"));
               
       
        String jpql = "select p.vendor from Employee e" +
                      " JOIN e.contactInfo c JOIN c.phones p" +
                      " where e.contactInfo.address.zipCode = '95094'";
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.