Package org.openengsb.core.edb.api

Examples of org.openengsb.core.edb.api.EDBObjectEntry


        return new JPAEntry(entry.getKey(), "" + ((Date) entry.getValue()).getTime(), entry.getType(), owner);
    }

    @Override
    public EDBObjectEntry convertToEDBObjectEntry(JPAEntry entry) {
        return new EDBObjectEntry(entry.getKey(), new Date(Long.parseLong(entry.getValue())), entry.getType());
    }
View Full Code Here


        return new JPAEntry(entry.getKey(), entry.getValue().toString(), entry.getType(), owner);
    }

    @Override
    public EDBObjectEntry convertToEDBObjectEntry(JPAEntry entry) {
        return new EDBObjectEntry(entry.getKey(), entry.getValue(), entry.getType());
    }
View Full Code Here

        return new JPAEntry(entry.getKey(), entry.getValue().toString(), entry.getType(), owner);
    }

    @Override
    public EDBObjectEntry convertToEDBObjectEntry(JPAEntry entry) {
        EDBObjectEntry result = new EDBObjectEntry();
        result.setKey(entry.getKey());
        result.setType(entry.getType());
        result.setValue(getEntryValue(entry));
        return result;
    }
View Full Code Here

        TestModel model = new TestModel();
        model.setNumber(42);
        ConnectorInformation id = getTestConnectorInformation();
        List<EDBObject> objects = converter.convertModelToEDBObject(model, id);
        EDBObject object = objects.get(0);
        EDBObjectEntry entry = object.get("number");
        assertThat(entry.getType(), is(Integer.class.getName()));
    }
View Full Code Here

     * Converts a JPAObject object into an EDBObject.
     */
    public static EDBObject convertJPAObjectToEDBObject(JPAObject object) {
        EDBObject result = new EDBObject(object.getOID());
        for (JPAEntry kvp : object.getEntries()) {
            EDBObjectEntry entry = convertJPAEntryToEDBObjectEntry(kvp);
            result.put(entry.getKey(), entry);
        }
        result.setDeleted(object.isDeleted());
        if (object.getTimestamp() != null) {
            result.updateTimestamp(object.getTimestamp());
        }
View Full Code Here

                entries.add(new OpenEngSBModelEntry(propertyDescriptor.getName(), value, propertyClass));
            }
        }

        for (Map.Entry<String, EDBObjectEntry> objectEntry : object.entrySet()) {
            EDBObjectEntry entry = objectEntry.getValue();
            Class<?> entryType;
            try {
                entryType = model.getClassLoader().loadClass(entry.getType());
                entries.add(new OpenEngSBModelEntry(entry.getKey(), entry.getValue(), entryType));
            } catch (ClassNotFoundException e) {
                LOGGER.error("Unable to load class {} of the model tail", entry.getType());
            }
        }
        return ModelUtils.createModel(model, entries);
    }
View Full Code Here

            if (value == null) {
                continue;
            }
            value = String.format("%s/%s", ContextHolder.get().getCurrentContextId(), value);
            String key = getEOReferenceStringFromAnnotation(annotation);
            object.put(key, new EDBObjectEntry(key, value, String.class));
        }
    }
View Full Code Here

    }

    @Test
    public void testIfRetrievingCommitByRevisionWorks_shouldWork() throws Exception {
        Map<String, EDBObjectEntry> entries = new HashMap<String, EDBObjectEntry>();
        entries.put("test", new EDBObjectEntry("test", "test", String.class));
        EDBObject obj = new EDBObject("/test/query/9", entries);
        EDBCommit ci = getEDBCommit();
        ci.insert(obj);
        db.commit(ci);
        EDBCommit test = db.getCommitByRevision(ci.getRevisionNumber().toString());
View Full Code Here

    }

    @Test
    public void testIfRetrievingCommitByRevisionWithIntermediateCommitsWorks_shouldWork() throws Exception {
        Map<String, EDBObjectEntry> entries = new HashMap<String, EDBObjectEntry>();
        entries.put("test", new EDBObjectEntry("test", "test", String.class));
        EDBObject obj = new EDBObject("/test/query/10", entries);
        EDBCommit ci = getEDBCommit();
        ci.insert(obj);
        db.commit(ci);
        String revision = ci.getRevisionNumber().toString();
View Full Code Here

    }

    @Test
    public void testIfRetrievingCommitRevisionsByRequestGivesCorrectRevisions_shouldWork() throws Exception {
        Map<String, EDBObjectEntry> entries = new HashMap<String, EDBObjectEntry>();
        entries.put("test", new EDBObjectEntry("test", "test", String.class));
        EDBObject obj = new EDBObject("/test/query/11", entries);
        EDBCommit ci = getEDBCommit();
        ci.insert(obj);
        Long timestamp1 = db.commit(ci);
        String revision1 = ci.getRevisionNumber().toString();
View Full Code Here

TOP

Related Classes of org.openengsb.core.edb.api.EDBObjectEntry

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.