Package org.openiaml.model.model.domain

Examples of org.openiaml.model.model.domain.DomainAttribute


    String q = "";
    for (EStructuralFeature feature : role.getEStructuralFeatures()) {
      if (!(feature instanceof DomainAttribute))
        continue;
     
      DomainAttribute attribute = (DomainAttribute) feature;
     
      // ignore primary keys
      if (notPrimaryKey(attribute)) {
        // ignore attributes which are extensions of other attributes;
        // these attributes will be selected later
        if (attribute.getOutExtendsEdges().isEmpty()) {
          // add this attribute as a query
          if (!q.isEmpty()) {
            q += " and ";
          }
          q += attribute.getName() + " = :" + attribute.getName();
        }
      }
    }
   
    // get all parents
View Full Code Here


    String q = "";
    for (Parameter wire : login_handler.getInParameterEdges()) {
      if (wire.getParameterValue() instanceof DomainAttribute &&
          dobj.equals(wire.getParameterValue().eContainer())) {
        // add this attribute as a query
        DomainAttribute attribute = (DomainAttribute) wire.getParameterValue();
        if (notPrimaryKey(attribute)) {
          if (!q.isEmpty()) {
            q += " and ";
          }
          q += attribute.getName() + " = :" + attribute.getName();
        }
      }
    }
   
    return q;
View Full Code Here

    assertEditorHasChildren(2, sub);
    {
      ShapeNodeEditPart p = assertHasDomainAttribute(sub, "da");
      assertNotNull(p);
     
      DomainAttribute obj = (DomainAttribute) p.resolveSemanticElement();
      assertEquals(obj.getName(), "da");
    }
    {
      ShapeNodeEditPart p = assertHasDomainAttribute(sub, "fa");
      assertNotNull(p);
     
      DomainAttribute obj = (DomainAttribute) p.resolveSemanticElement();
      assertEquals(obj.getName(), "fa");
    }
   
    sub.close(false);
  }
View Full Code Here

    setGeneratedBy(obj, by);
    return obj;
  }

  public DomainAttribute generatedDomainAttribute(GeneratesElements by, DomainType container) throws InferenceException {
    DomainAttribute obj = (DomainAttribute) createElement( container, DomainPackage.eINSTANCE.getDomainAttribute(), EcorePackage.eINSTANCE.getEClass_EStructuralFeatures() );
    setGeneratedBy(obj, by);
    return obj;
  }
View Full Code Here

    assertNotGenerated(session);

    DomainType obj = assertHasDomainType(root, "User");
    assertNotGenerated(obj);

    DomainAttribute password = assertHasDomainAttribute(obj, "password");
    assertNotGenerated(password);

    LoginHandler handler = assertHasLoginHandler(session, "login handler");
    assertNotGenerated(handler);
    assertEquals(handler.getType(), LoginHandlerTypes.DOMAIN_OBJECT);
View Full Code Here

    // iterator has a source
    assertHasSelectEdge(iterator, db);

    // attributes in the schema
    DomainAttribute id = assertHasDomainAttribute(news, "id");
    DomainAttribute title = assertHasDomainAttribute(news, "title");
    DomainAttribute content = assertHasDomainAttribute(news, "content");

    assertEquals(((EXSDDataType) id.getEType()).getDefinition().getURI(), BuiltinDataTypes.getTypeInteger().getURI());
    assertEquals(((EXSDDataType) title.getEType()).getDefinition().getURI(), BuiltinDataTypes.getTypeString().getURI());
    assertEquals(((EXSDDataType) content.getEType()).getDefinition().getURI(), BuiltinDataTypes.getTypeString().getURI());

  }
View Full Code Here

    assertGenerated(iid);
    assertGenerated(ititle);
    assertGenerated(icontent);

    // correct data types
    DomainAttribute id = assertHasDomainAttribute(news, "id");
    DomainAttribute title = assertHasDomainAttribute(news, "title");
    DomainAttribute content = assertHasDomainAttribute(news, "content");

    assertEqualType(id, iid);
    assertEqualType(title, ititle);
    assertEqualType(content, icontent);
View Full Code Here

    assertTrue(ltitle.isVisible());
    assertTrue(lcontent.isVisible());

    // same data types
    // attributes in the schema
    DomainAttribute id = assertHasDomainAttribute(news, "id");
    DomainAttribute title = assertHasDomainAttribute(news, "title");
    DomainAttribute content = assertHasDomainAttribute(news, "content");

    assertEqualType(id, lid);
    assertEqualType(title, ltitle);
    assertEqualType(content, lcontent);
View Full Code Here

  }

  public void testNotPrimaryKey() throws Exception {
   
    DomainType d1 = assertHasDomainType(root, "Not Empty");
    DomainAttribute a1 = assertHasDomainAttribute(d1, "attr1");
    DomainType d3 = assertHasDomainType(root, "Generated Primary Key");
    DomainAttribute a2 = assertHasDomainAttribute(d3, "generated primary key");
   
    assertTrue(getHelper().notPrimaryKey(a1));
    assertFalse(getHelper().notPrimaryKey(a2));
   
  }
View Full Code Here

  private void assertExtends(DomainAttributeInstance attr, String name) throws Exception {
    List<ExtendsEdge> edges = attr.getOutExtendsEdges();
    assertEquals(1, edges.size());
    ExtendsEdge ext = (ExtendsEdge) edges.iterator().next();
   
    DomainAttribute targetAttr = (DomainAttribute) ext.getTo();
    assertNotNull(targetAttr);
   
    DomainType targetObj = (DomainType) targetAttr.eContainer();
    assertNotNull(targetObj);   
    assertEquals(name, targetObj.getName());
  }
View Full Code Here

TOP

Related Classes of org.openiaml.model.model.domain.DomainAttribute

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.