Examples of addSupertype()


Examples of org.drools.lang.descr.TypeDeclarationDescr.addSuperType()

                        TypeDeclarationDescr tempDescr = new TypeDeclarationDescr();
                        tempDescr.setNamespace( typeDescr.getNamespace() );
                        tempDescr.setFields( typeDescr.getFields() );
                        tempDescr.setType( target,
                                           typeDescr.getNamespace() );
                        tempDescr.addSuperType( typeDescr.getType() );
                        TypeDeclaration tempDeclr = new TypeDeclaration( target );
                        tempDeclr.setKind( TypeDeclaration.Kind.TRAIT );
                        tempDeclr.setTypesafe( type.isTypesafe() );
                        tempDeclr.setNovel( true );
                        tempDeclr.setTypeClassName( tempDescr.getType().getFullName() );
View Full Code Here

Examples of org.lilyproject.repository.api.RecordType.addSupertype()

                String rtIdString = getString(supertype, "id", null);
                String rtName = getString(supertype, "name", null);
                Long rtVersion = getLong(supertype, "version", null);

                if (rtIdString != null) {
                    recordType.addSupertype(new SchemaIdImpl(rtIdString), rtVersion);
                } else if (rtName != null) {
                    QName rtQName = QNameConverter.fromJson(rtName, namespaces);

                    try {
                        SchemaId rtId = typeManager.getRecordTypeByName(rtQName, null).getId();
View Full Code Here

Examples of org.lilyproject.repository.api.RecordType.addSupertype()

                } else if (rtName != null) {
                    QName rtQName = QNameConverter.fromJson(rtName, namespaces);

                    try {
                        SchemaId rtId = typeManager.getRecordTypeByName(rtQName, null).getId();
                        recordType.addSupertype(rtId, rtVersion);
                    } catch (RepositoryException e) {
                        throw new JsonFormatException("Record type " + name +
                                ": error looking up supertype record type with name: " + rtQName, e);
                    }
                } else {
View Full Code Here

Examples of org.lilyproject.repository.api.RecordType.addSupertype()

        // Create a record type with two versions
        RecordType rt = typeManager.newRecordType(new QName(NS, "sf_rt"));
        rt.addFieldTypeEntry(field1.getId(), false);
        rt.addFieldTypeEntry(field2.getId(), false);
        rt.addSupertype(supertype1.getId());
        rt = typeManager.createRecordType(rt);

        rt.addSupertype(supertype2.getId(), supertype2.getVersion());
        rt = typeManager.updateRecordType(rt);
View Full Code Here

Examples of org.lilyproject.repository.api.RecordType.addSupertype()

        rt.addFieldTypeEntry(field1.getId(), false);
        rt.addFieldTypeEntry(field2.getId(), false);
        rt.addSupertype(supertype1.getId());
        rt = typeManager.createRecordType(rt);

        rt.addSupertype(supertype2.getId(), supertype2.getVersion());
        rt = typeManager.updateRecordType(rt);

        RecordType rt2 = typeManager.newRecordType(new QName(NS, "sf_rt2"));
        rt2.addFieldTypeEntry(field1.getId(), false);
        rt2.addFieldTypeEntry(field2.getId(), false);
View Full Code Here

Examples of org.lilyproject.repository.api.RecordType.addSupertype()

    @Test
    public void testSupertypeLatestVersion() throws Exception {
        RecordType recordType4 = typeManager.newRecordType(new QName(namespace, "RT4"));
        recordType4.addFieldTypeEntry(typeManager.newFieldTypeEntry(fieldType6.getId(), false));
        recordType4.addSupertype(recordType1.getId()); // In fact recordType1B should be taken as supertype
        recordType4 = typeManager.createRecordType(recordType4);

        Record record = repository.newRecord(idGenerator.newRecordId());
        record.setRecordType(recordType4.getName(), recordType4.getVersion());
        record.setField(fieldType1.getName(), "foo");
View Full Code Here

Examples of org.lilyproject.repository.api.RecordType.addSupertype()

        expectLastCall().andReturn(recordType);

        control.replay();
        converter = new AvroConverter();
        SchemaId supertypeId1 = new SchemaIdImpl(UUID.randomUUID());
        recordType.addSupertype(supertypeId1, 1L);
        SchemaId supertypeId2 = new SchemaIdImpl(UUID.randomUUID());
        recordType.addSupertype(supertypeId2, 2L);
        AvroRecordType avroRecordType = new AvroRecordType();
        AvroSchemaId avroRecordTypeId = new AvroSchemaId();
        avroRecordTypeId.idBytes = ByteBuffer.wrap(recordTypeId.getBytes());
View Full Code Here

Examples of org.lilyproject.repository.api.RecordType.addSupertype()

        control.replay();
        converter = new AvroConverter();
        SchemaId supertypeId1 = new SchemaIdImpl(UUID.randomUUID());
        recordType.addSupertype(supertypeId1, 1L);
        SchemaId supertypeId2 = new SchemaIdImpl(UUID.randomUUID());
        recordType.addSupertype(supertypeId2, 2L);
        AvroRecordType avroRecordType = new AvroRecordType();
        AvroSchemaId avroRecordTypeId = new AvroSchemaId();
        avroRecordTypeId.idBytes = ByteBuffer.wrap(recordTypeId.getBytes());
        avroRecordType.id = avroRecordTypeId;
        AvroQName avroQName = new AvroQName();
View Full Code Here

Examples of org.lilyproject.repository.api.RecordType.addSupertype()

        supertypeRt.addFieldTypeEntry(typeManager.newFieldTypeEntry(fieldType3.getId(), false));
        supertypeRt = typeManager.createRecordType(supertypeRt);

        QName recordName = new QName("recordNS", "testSupertype");
        RecordType recordType = typeManager.newRecordType(recordName);
        recordType.addSupertype(supertypeRt.getId(), supertypeRt.getVersion());
        recordType = typeManager.createRecordType(recordType);
        assertEquals(Long.valueOf(1), recordType.getVersion());
        assertEquals(recordType, typeManager.getRecordTypeById(recordType.getId(), null));
    }
View Full Code Here

Examples of org.lilyproject.repository.api.RecordType.addSupertype()

        supertypeType.addFieldTypeEntry(typeManager.newFieldTypeEntry(fieldType3.getId(), false));
        supertypeType = typeManager.updateRecordType(supertypeType);

        QName recordName = new QName("recordNS", "testSupertypeLatestVersion");
        RecordType recordType = typeManager.newRecordType(recordName);
        recordType.addSupertype(supertypeType.getId());
        recordType = typeManager.createRecordType(recordType);
        assertEquals(Long.valueOf(1), recordType.getVersion());

        recordType.addSupertype(supertypeType.getId(), 2L); // Assert latest version of the supertype RecordType got filled in
        assertEquals(recordType, typeManager.getRecordTypeById(recordType.getId(), null));
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.