Examples of OSchema


Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  @Test(dependsOnMethods = "createSchema")
  public void checkSchema() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();

    assert schema != null;
    assert schema.getClass("Profile") != null;
    assert schema.getClass("Profile").getProperty("nick").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("name").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("surname").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("registeredOn").getType() == OType.DATETIME;
    assert schema.getClass("Profile").getProperty("lastAccessOn").getType() == OType.DATETIME;

    assert schema.getClass("Whiz") != null;
    assert schema.getClass("whiz").getProperty("account").getType() == OType.LINK;
    assert schema.getClass("whiz").getProperty("account").getLinkedClass().getName().equalsIgnoreCase("Profile");
    assert schema.getClass("WHIZ").getProperty("date").getType() == OType.DATE;
    assert schema.getClass("WHIZ").getProperty("text").getType() == OType.STRING;
    assert schema.getClass("WHIZ").getProperty("text").isMandatory();
    assert schema.getClass("WHIZ").getProperty("text").getMin().equals("1");
    assert schema.getClass("WHIZ").getProperty("text").getMax().equals("140");
    assert schema.getClass("whiz").getProperty("replyTo").getType() == OType.LINK;
    assert schema.getClass("Whiz").getProperty("replyTo").getLinkedClass().getName().equalsIgnoreCase("Profile");

    database.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  @Test(dependsOnMethods = "checkSchema")
  public void checkSchemaApi() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();

    try {
      Assert.assertNull(schema.getClass("Animal33"));
    } catch (OSchemaException e) {
    }

    database.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  @Test(dependsOnMethods = "createSchema")
  public void checkSchema() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();

    assert schema != null;
    assert schema.getClass("Profile") != null;
    assert schema.getClass("Profile").getProperty("nick").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("name").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("surname").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("registeredOn").getType() == OType.DATE;
    assert schema.getClass("Profile").getProperty("lastAccessOn").getType() == OType.DATE;

    assert schema.getClass("Whiz") != null;
    assert schema.getClass("whiz").getProperty("account").getType() == OType.LINK;
    assert schema.getClass("whiz").getProperty("account").getLinkedClass().getName().equalsIgnoreCase("Profile");
    assert schema.getClass("WHIZ").getProperty("date").getType() == OType.DATE;
    assert schema.getClass("WHIZ").getProperty("text").getType() == OType.STRING;
    assert schema.getClass("WHIZ").getProperty("text").isMandatory();
    assert schema.getClass("WHIZ").getProperty("text").getMin().equals("1");
    assert schema.getClass("WHIZ").getProperty("text").getMax().equals("140");
    assert schema.getClass("whiz").getProperty("replyTo").getType() == OType.LINK;
    assert schema.getClass("Whiz").getProperty("replyTo").getLinkedClass().getName().equalsIgnoreCase("Profile");

    database.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  @Test(dependsOnMethods = "checkSchema")
  public void checkSchemaApi() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();

    try {
      Assert.assertNull(schema.getClass("Animal33"));
    } catch (OSchemaException e) {
    }

    database.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  }

  private void init() {
    schemaClusterId = database.getClusterIdByName(OStorage.CLUSTER_INTERNAL_NAME);

    schema = new OSchema(database, schemaClusterId);
    security = new OSecurity(database);
    indexManager = new OIndexManager(database);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  private void exportSchema() throws IOException {
    listener.onMessage("\nExporting schema...");

    writer.beginObject(1, true, "schema");
    OSchema s = database.getMetadata().getSchema();
    writer.writeAttribute(2, true, "version", s.getDocument().getVersion());

    if (s.getClasses().size() > 0) {
      writer.beginCollection(2, true, "classes");

      final List<OClass> classes = new ArrayList<OClass>(s.getClasses());
      Collections.sort(classes);

      for (OClass cls : classes) {
        writer.beginObject(3, true, null);
        writer.writeAttribute(0, false, "name", cls.getName());
        writer.writeAttribute(0, false, "id", cls.getId());
        writer.writeAttribute(0, false, "default-cluster-id", cls.getDefaultClusterId());
        writer.writeAttribute(0, false, "cluster-ids", cls.getClusterIds());
        if (cls.getSuperClass() != null)
          writer.writeAttribute(0, false, "super-class", cls.getSuperClass().getName());

        if (cls.properties().size() > 0) {
          writer.beginCollection(4, true, "properties");

          final List<OProperty> properties = new ArrayList<OProperty>(cls.declaredProperties());
          Collections.sort(properties);

          for (OProperty p : properties) {
            writer.beginObject(5, true, null);
            writer.writeAttribute(0, false, "name", p.getName());
            writer.writeAttribute(0, false, "id", p.getId());
            writer.writeAttribute(0, false, "type", p.getType().toString());
            if (p.getLinkedClass() != null)
              writer.writeAttribute(0, false, "linked-class", p.getLinkedClass().getName());
            if (p.getLinkedType() != null)
              writer.writeAttribute(0, false, "linked-type", p.getLinkedType().toString());
            if (p.getMin() != null)
              writer.writeAttribute(0, false, "min", p.getMin());
            if (p.getMax() != null)
              writer.writeAttribute(0, false, "max", p.getMax());
            if (p.getIndex() != null)
              writer.writeAttribute(0, false, "index", p.getIndex().getUnderlying().getName());

            writer.endObject(0, false);
          }
          writer.endCollection(4, true);
        }

        writer.endObject(3, true);
      }
      writer.endCollection(2, true);
    }

    writer.endObject(1, true);

    listener.onMessage("OK (" + s.getClasses().size() + " classes)");
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  @Test(dependsOnMethods = "createSchema")
  public void checkSchema() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();

    assert schema != null;
    assert schema.getClass("Profile") != null;
    assert schema.getClass("Profile").getProperty("nick").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("name").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("surname").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("registeredOn").getType() == OType.DATETIME;
    assert schema.getClass("Profile").getProperty("lastAccessOn").getType() == OType.DATETIME;

    assert schema.getClass("Whiz") != null;
    assert schema.getClass("whiz").getProperty("account").getType() == OType.LINK;
    assert schema.getClass("whiz").getProperty("account").getLinkedClass().getName().equalsIgnoreCase("Profile");
    assert schema.getClass("WHIZ").getProperty("date").getType() == OType.DATE;
    assert schema.getClass("WHIZ").getProperty("text").getType() == OType.STRING;
    assert schema.getClass("WHIZ").getProperty("text").isMandatory();
    assert schema.getClass("WHIZ").getProperty("text").getMin().equals("1");
    assert schema.getClass("WHIZ").getProperty("text").getMax().equals("140");
    assert schema.getClass("whiz").getProperty("replyTo").getType() == OType.LINK;
    assert schema.getClass("Whiz").getProperty("replyTo").getLinkedClass().getName().equalsIgnoreCase("Profile");

    database.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  @Test(dependsOnMethods = "checkSchema")
  public void checkSchemaApi() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();

    try {
      Assert.assertNull(schema.getClass("Animal33"));
    } catch (OSchemaException e) {
    }

    database.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  @Test(dependsOnMethods = "createSchema")
  public void checkSchema() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();

    assert schema != null;
    assert schema.getClass("Profile") != null;
    assert schema.getClass("Profile").getProperty("nick").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("name").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("surname").getType() == OType.STRING;
    assert schema.getClass("Profile").getProperty("registeredOn").getType() == OType.DATETIME;
    assert schema.getClass("Profile").getProperty("lastAccessOn").getType() == OType.DATETIME;

    assert schema.getClass("Whiz") != null;
    assert schema.getClass("whiz").getProperty("account").getType() == OType.LINK;
    assert schema.getClass("whiz").getProperty("account").getLinkedClass().getName().equalsIgnoreCase("Profile");
    assert schema.getClass("WHIZ").getProperty("date").getType() == OType.DATE;
    assert schema.getClass("WHIZ").getProperty("text").getType() == OType.STRING;
    assert schema.getClass("WHIZ").getProperty("text").isMandatory();
    assert schema.getClass("WHIZ").getProperty("text").getMin().equals("1");
    assert schema.getClass("WHIZ").getProperty("text").getMax().equals("140");
    assert schema.getClass("whiz").getProperty("replyTo").getType() == OType.LINK;
    assert schema.getClass("Whiz").getProperty("replyTo").getLinkedClass().getName().equalsIgnoreCase("Profile");

    database.close();
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OSchema

  @Test(dependsOnMethods = "checkSchema")
  public void checkSchemaApi() {
    database = new ODatabaseFlat(url);
    database.open("admin", "admin");

    OSchema schema = database.getMetadata().getSchema();

    try {
      Assert.assertNull(schema.getClass("Animal33"));
    } catch (OSchemaException e) {
    }

    database.close();
  }
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.