Examples of toUuid()


Examples of org.apache.cayenne.lifecycle.uuid.UuidCoder.toUuid()

        if (referenceable instanceof Persistent) {

            ObjectId id = ((Persistent) referenceable).getObjectId();

            UuidCoder coder = getCoder(id.getEntityName());
            return coder.toUuid(id);
        }
        else {
            throw new IllegalArgumentException("Object is not a DataObject: "
                    + referenceable.getClass().getName());
        }
View Full Code Here

Examples of org.apache.cayenne.lifecycle.uuid.UuidCoder.toUuid()

        for (SelectQuery query : queriesByEntity.values()) {

            UuidCoder coder = codersByEntity.get(query.getRoot());
            List<DataObject> objects = context.performQuery(query);
            for (DataObject object : objects) {
                String uuid = coder.toUuid(object.getObjectId());
                results.put(uuid, object);
            }
        }

        return results;
View Full Code Here

Examples of org.apache.cayenne.lifecycle.uuid.UuidCoder.toUuid()

        when(entity.getDbEntity()).thenReturn(dbEntity);

        ObjectId id = new ObjectId("x", "ID", 3);

        UuidCoder coder = new UuidCoder(entity);
        assertEquals("x:3", coder.toUuid(id));

        ObjectId parsedId = coder.toObjectId("x:3");
        assertEquals(id, parsedId);
    }
View Full Code Here

Examples of org.apache.cayenne.lifecycle.uuid.UuidCoder.toUuid()

        when(entity.getDbEntity()).thenReturn(dbEntity);

        ObjectId id = new ObjectId("x", "ID", 3l);

        UuidCoder coder = new UuidCoder(entity);
        assertEquals("x:3", coder.toUuid(id));

        ObjectId parsedId = coder.toObjectId("x:3");
        assertEquals(id, parsedId);
    }
View Full Code Here

Examples of org.apache.cayenne.lifecycle.uuid.UuidCoder.toUuid()

        when(entity.getDbEntity()).thenReturn(dbEntity);

        UuidCoder coder = new UuidCoder(entity);

        ObjectId id = new ObjectId("x", "ID", "AbC");
        assertEquals("x:AbC", coder.toUuid(id));

        ObjectId parsedId = coder.toObjectId("x:AbC");
        assertEquals(id, parsedId);
    }
View Full Code Here

Examples of org.apache.cayenne.lifecycle.uuid.UuidCoder.toUuid()

        when(entity.getDbEntity()).thenReturn(dbEntity);

        UuidCoder coder = new UuidCoder(entity);

        ObjectId id = new ObjectId("x", "ID", "Ab:C");
        assertEquals("x:Ab%3AC", coder.toUuid(id));

        ObjectId parsedId = coder.toObjectId("x:Ab%3AC");
        assertEquals(id, parsedId);
    }
View Full Code Here

Examples of org.apache.cayenne.lifecycle.uuid.UuidCoder.toUuid()

        Map<String, Object> idMap = new HashMap<String, Object>();
        idMap.put("ID", "X;Y");
        idMap.put("ABC", 6783463l);
        idMap.put("ZZZ", "'_'");
        ObjectId id = new ObjectId("x", idMap);
        assertEquals("x:6783463:X%3BY:%27_%27", coder.toUuid(id));

        ObjectId parsedId = coder.toObjectId("x:6783463:X%3BY:%27_%27");
        assertEquals(id, parsedId);
    }
}
View Full Code Here

Examples of org.apache.sis.xml.ValueConverter.toUUID()

    private void setUUID(String id) {
        final Context context = Context.current();
        final ValueConverter converter = Context.converter(context);
        final UUID uuid;
        try {
            uuid = converter.toUUID(context, id);
        } catch (IllegalArgumentException e) {
            // IF we can not store the value as a UUID, store it as a String.
            Context.warningOccured(context, this, ISOMetadata.class, "setUUID", e, false);
            id = CharSequences.trimWhitespaces(id);
            if (id != null && !id.isEmpty()) {
View Full Code Here

Examples of org.apache.sis.xml.ValueConverter.toUUID()

                }
                case NonMarshalledAuthority.UUID: {
                    final Context context = Context.current();
                    final ValueConverter converter = Context.converter(context);
                    try {
                        return new SpecializedIdentifier<UUID>(IdentifierSpace.UUID, converter.toUUID(context, code));
                    } catch (IllegalArgumentException e) {
                        parseFailure(context, code, UUID.class, e);
                        break;
                    }
                }
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.