Package org.apache.isis.runtimes.dflt.objectstores.xml.internal.data

Examples of org.apache.isis.runtimes.dflt.objectstores.xml.internal.data.ObjectData


        if (LOG.isDebugEnabled()) {
            LOG.debug("compiling object data for " + adapter);
        }

        final ObjectSpecification adapterSpec = adapter.getSpecification();
        final ObjectData data = new ObjectData(adapterSpec, (SerialOid) adapter.getOid(), (FileVersion) adapter.getVersion());

        final List<ObjectAssociation> associations = adapterSpec.getAssociations();
        for (final ObjectAssociation association : associations) {
            if (association.isNotPersisted()) {
                continue;
View Full Code Here


        if (LOG.isDebugEnabled()) {
            LOG.debug("  create object " + onObject());
        }
        final String user = getAuthenticationSession().getUserName();
        onObject().setOptimisticLock(new FileVersion(user));
        final ObjectData data = createObjectData(onObject(), true);
        getDataManager().insertObject(data);
    }
View Full Code Here

    // /////////////////////////////////////////////////////////

    @Override
    public boolean hasInstances(final ObjectSpecification cls) {
        LOG.debug("checking instance of " + cls);
        final ObjectData data = new ObjectData(cls, null, null);
        return dataManager.numberOfInstances(data) > 0;
    }
View Full Code Here

        resolveImmediately(reference);
    }

    @Override
    public void resolveImmediately(final ObjectAdapter object) {
        final ObjectData data = (ObjectData) dataManager.loadData((SerialOid) object.getOid());
        Assert.assertNotNull("Not able to read in data during resolve", object, data);
        initObject(object, data);
    }
View Full Code Here

            throw new IllegalArgumentException(MessageFormat.format("Provided PersistenceQuery not supported; was {0}; " + "the XML object store only supports {1}", persistenceQuery.getClass().getName(), PersistenceQueryBuiltIn.class.getName()));
        }
        final PersistenceQueryBuiltIn builtIn = (PersistenceQueryBuiltIn) persistenceQuery;

        LOG.debug("getInstances of " + builtIn.getSpecification() + " where " + builtIn);
        final ObjectData patternData = new ObjectData(builtIn.getSpecification(), null, null);
        final ObjectAdapter[] instances = getInstances(patternData, builtIn);
        return instances;
    }
View Full Code Here

        final ObjectDataVector data = dataManager.getInstances(patternData);
        final ObjectAdapter[] instances = new ObjectAdapter[data.size()];
        int count = 0;

        for (int i = 0; i < data.size(); i++) {
            final ObjectData instanceData = data.element(i);
            LOG.debug("instance data " + instanceData);

            final SerialOid oid = instanceData.getOid();

            final ObjectSpecification spec = specFor(instanceData);
            final ObjectAdapter instance = getPersistenceSession().recreateAdapter(oid, spec);
            LOG.debug("recreated instance " + instance);
            initObject(instance, instanceData);
View Full Code Here

            return new ObjectDataVector();
        }

        final ObjectDataVector matches = new ObjectDataVector();
        for (final SerialOid oid : instances) {
            final ObjectData instanceData = (ObjectData) loadData(oid);
            // TODO check loader first
            if (instanceData == null) {
                throw new IsisException("No data found for " + oid + " (possible missing file)");
            }
            if (matchesPattern(pattern, instanceData)) {
View Full Code Here

            }
        });
    }

    private void writeObject(final Data data, final StringBuffer xml) {
        final ObjectData object = (ObjectData) data;
        for (final String field : object.fields()) {
            writeField(xml, object, field);
        }
    }
View Full Code Here

                    final long version = Long.valueOf(attributes.getValue("ver"), 16).longValue();
                    final String user = attributes.getValue("user");
                    final long id = Long.valueOf(attributes.getValue("id"), 16).longValue();
                    final ObjectSpecification spec = IsisContext.getSpecificationLoader().loadSpecification(typeName);
                    final SerialOid oid = SerialOid.createPersistent(id);
                    object = new ObjectData(spec, oid, new FileVersion(user, version));
                } else if (tagName.equals("collection")) {
                    final String type = attributes.getValue("type");
                    final long version = Long.valueOf(attributes.getValue("ver"), 16).longValue();
                    final String user = attributes.getValue("user");
                    final long id = Long.valueOf(attributes.getValue("id"), 16).longValue();
View Full Code Here

        oids = new SerialOid[SIZE];
        data = new ObjectData[SIZE];

        final ObjectSpecification type = system.getSpecification(Object.class);
        pattern = new ObjectData(type, null, new FileVersion("user", 13));
        for (int i = 0; i < SIZE; i++) {
            oids[i] = SerialOid.createPersistent(i);
            data[i] = new ObjectData(type, oids[i], new FileVersion("user", 13));
            manager.insertObject(data[i]);
        }

        LOG.debug("test starting...");
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.objectstores.xml.internal.data.ObjectData

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.