Package org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple.SerialOid


    public void hasInstances() throws Exception {
        Logger.getRootLogger().setLevel(Level.OFF);

        final TrialObjects testObjects = new TrialObjects();

        final SerialOid oid = SerialOid.createTransient(1);
        final ExampleValuePojo pojo = new ExampleValuePojo();

        final ObjectAdapter adapter = testObjects.createAdapter(pojo, oid);

        final ObjectSpecification loadSpecification = testObjects.loadSpecification(ExampleValuePojo.class);
View Full Code Here


    @Override
    public void execute(final PersistenceCommandContext context) throws ObjectPersistenceException {
        if (LOG.isDebugEnabled()) {
            LOG.debug("  destroy object " + onObject());
        }
        final SerialOid oid = (SerialOid) onObject().getOid();
        getDataManager().remove(oid);
        onObject().setOptimisticLock(null);
    }
View Full Code Here

            PersistorUtil.end(object);
        }
    }

    private void initObjectSetupReference(final ObjectAdapter object, final ObjectData data, final ObjectAssociation field) {
        final SerialOid referenceOid = (SerialOid) data.get(field.getId());
        LOG.debug("setting up field " + field + " with " + referenceOid);
        if (referenceOid == null) {
            return;
        }
View Full Code Here

        if (collection.getResolveState().canChangeTo(ResolveState.RESOLVING)) {
            PersistorUtil.start(collection, ResolveState.RESOLVING);
            final int size = refs == null ? 0 : refs.size();
            final ObjectAdapter[] elements = new ObjectAdapter[size];
            for (int j = 0; j < size; j++) {
                final SerialOid elementOid = refs.elementAt(j);
                ObjectAdapter adapter;
                adapter = getAdapterManager().getAdapterFor(elementOid);
                if (adapter == null) {
                    adapter = getObject(elementOid, null);
                }
View Full Code Here

    /*
     * The ObjectData holds all references for internal collections, so the
     * object should haves its internal collection populated by this method.
     */
    private ObjectAdapter recreateObject(final ObjectData data) {
        final SerialOid oid = data.getOid();
        final ObjectSpecification spec = specFor(data);
        final ObjectAdapter object = getPersistenceSession().recreateAdapter(oid, spec);
        initObject(object, data);
        return object;
    }
View Full Code Here

        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

            final Object candidateFieldValue = candidateData.get(field);

            if (candidateFieldValue instanceof ReferenceVector) {
                final ReferenceVector patternElements = (ReferenceVector) patternFieldValue;
                for (int i = 0; i < patternElements.size(); i++) {
                    final SerialOid requiredElement = patternElements.elementAt(i); // must
                    // have
                    // this
                    // element
                    boolean requiredFound = false;
                    final ReferenceVector testElements = ((ReferenceVector) candidateFieldValue);
                    for (int j = 0; j < testElements.size(); j++) {
                        if (requiredElement.equals(testElements.elementAt(j))) {
                            requiredFound = true;
                            break;
                        }
                    }
                    if (!requiredFound) {
View Full Code Here

                    final String typeName = 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();
                    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();
                    final ObjectSpecification spec = IsisContext.getSpecificationLoader().loadSpecification(type);
                    final SerialOid oid = SerialOid.createPersistent(id);
                    collection = new CollectionData(spec, oid, new FileVersion(user, version));
                } else {
                    throw new SAXException("Invalid data");
                }
            }
View Full Code Here

        services = handler.services;
    }

    @Override
    public void registerService(final String name, final Oid oid) {
        final SerialOid soid = (SerialOid) oid;
        final ServiceElement element = new ServiceElement(soid, name);
        services.addElement(element);
        saveServices();
    }
View Full Code Here

        testObjects = new TrialObjects();

        final ExampleValuePojo pojo1 = new ExampleValuePojo();
        pojo1.setName("Fred Smith");
        pojo1.setSize(108);
        SerialOid oid = SerialOid.createPersistent(3);
        object1 = testObjects.createAdapter(pojo1, oid);
        specification = object1.getSpecification();

        final ExampleValuePojo pojo2 = new ExampleValuePojo();
        pojo2.setName("John Brown");
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.persistence.oidgenerator.simple.SerialOid

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.