Package com.orientechnologies.orient.core.metadata.schema

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.properties()


      out.println("Properties:");
      out.println("-------------------------------+----+-------------+-------------------------------+-----------+-----------+----------+------+------+");
      out.println(" NAME                          | ID | TYPE        | LINKED TYPE/CLASS             | INDEX     | MANDATORY | NOT NULL | MIN  | MAX  |");
      out.println("-------------------------------+----+-------------+-------------------------------+-----------+-----------+----------+------+------+");

      for (OProperty p : cls.properties()) {
        try {
          out.printf(" %-30s|%3d | %-12s| %-30s| %-10s| %-10s| %-9s| %-5s| %-5s|\n", p.getName(), p.getId(), p.getType(),
              p.getLinkedClass() != null ? p.getLinkedClass() : p.getLinkedType(), p.getIndex() != null ? p.getIndex()
                  .getUnderlying().getType() : "", p.isMandatory(), p.isNotNull(), p.getMin() != null ? p.getMin() : "",
              p.getMax() != null ? p.getMax() : "");
View Full Code Here


        ++i;
      }
      out.println();
    }

    if (cls.properties().size() > 0) {
      message("\n\nPROPERTIES");
      message("\n-------------------------------+-------------+-------------------------------+-----------+----------+----------+-----------+-----------+----------+");
      message("\n NAME                          | TYPE        | LINKED TYPE/CLASS             | MANDATORY | READONLY | NOT NULL |    MIN    |    MAX    | COLLATE  |");
      message("\n-------------------------------+-------------+-------------------------------+-----------+----------+----------+-----------+-----------+----------+");
View Full Code Here

      message("\n\nPROPERTIES");
      message("\n-------------------------------+-------------+-------------------------------+-----------+----------+----------+-----------+-----------+----------+");
      message("\n NAME                          | TYPE        | LINKED TYPE/CLASS             | MANDATORY | READONLY | NOT NULL |    MIN    |    MAX    | COLLATE  |");
      message("\n-------------------------------+-------------+-------------------------------+-----------+----------+----------+-----------+-----------+----------+");

      for (final OProperty p : cls.properties()) {
        try {
          message("\n %-30s| %-12s| %-30s| %-10s| %-9s| %-9s| %-10s| %-10s| %-9s|", p.getName(), p.getType(),
              p.getLinkedClass() != null ? p.getLinkedClass() : p.getLinkedType(), p.isMandatory(), p.isReadonly(), p.isNotNull(),
              p.getMin() != null ? p.getMin() : "", p.getMax() != null ? p.getMax() : "", p.getCollate() != null ? p.getCollate()
                  .getName() : "");
View Full Code Here

      eventData.createProperty("userId", OType.STRING);
      eventData.createProperty("sessionId", OType.STRING);
      eventData.createProperty("attributes", OType.EMBEDDEDMAP);

      log("Class: {}", eventData);
      log("Properties: {}", eventData.properties());

      // can count since we have defined schema
      log("Count: {}", db.countClass("EventData"));
    }
View Full Code Here

    try (ODatabaseDocumentTx db = openDatabase()) {
      OSchema schema = db.getMetadata().getSchema();
      OClass eventData = schema.getClass("EventData");

      log("Class: {}", eventData);
      log("Properties: {}", eventData.properties());
    }
  }
}
View Full Code Here

      type.createProperty(P_CONFIGURATION, OType.EMBEDDEDMAP);

      type.createIndex(DB_CLASS + "_" + P_SOURCEID_NAME + "idx", INDEX_TYPE.UNIQUE, P_SOURCEID_NAME);
      type.createIndex(DB_CLASS + "_" + P_SOURCEID_ID + "idx", INDEX_TYPE.UNIQUE, P_SOURCEID_ID);

      log.info("Created schema: {}, properties: {}", type, type.properties());
    }
    return type;
  }

  /**
 
View Full Code Here

      type.createProperty(P_FACTORYNAME, OType.STRING).setNotNull(true);
      type.createProperty(P_CONFIGURATION, OType.EMBEDDEDMAP);

      type.createIndex(DB_CLASS + "_" + P_VIEWNAME + "idx", INDEX_TYPE.UNIQUE, P_VIEWNAME);
      type.createIndex(DB_CLASS + "_" + P_VIEWID + "idx", INDEX_TYPE.UNIQUE, P_VIEWID);
      log.info("Created schema: {}, properties: {}", type, type.properties());
    }
    return type;
  }

  /**
 
View Full Code Here

      type.createProperty(P_PATH, OType.STRING).setNotNull(true);
      type.createIndex(P_PATH + "idx", INDEX_TYPE.UNIQUE, P_PATH);
      type.createProperty(P_BLOBID, OType.STRING).setNotNull(true);
      type.createProperty(P_CONTENTTYPE, OType.STRING);

      log.info("Created schema: {}, properties: {}", type, type.properties());
    }
    return type;
  }

  /**
 
View Full Code Here

      type.createProperty(P_TYPE, OType.STRING);
      type.createProperty(P_ENABLED, OType.BOOLEAN);
      type.createProperty(P_NOTES, OType.STRING);
      type.createProperty(P_PROPERTIES, OType.EMBEDDEDMAP);

      log.info("Created schema: {}, properties: {}", type, type.properties());
    }
    return type;
  }

  /**
 
View Full Code Here

        type.createProperty(P_SUBTYPE, OType.STRING);
        type.createProperty(P_DATA, OType.EMBEDDEDMAP, OType.STRING);
        type.createIndex(I_TYPE, INDEX_TYPE.NOTUNIQUE_HASH_INDEX, P_TYPE);
        type.createIndex(I_SUBTYPE, INDEX_TYPE.NOTUNIQUE_HASH_INDEX, P_SUBTYPE);

        log.info("Created schema: {}, properties: {}", type, type.properties());
      }
    }

    this.pool = databaseManager.newPool(DB_NAME);
  }
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.