try (ODatabaseDocumentTx db = databaseManager.connect(DB_NAME, true)) {
// entities
final OSchema schema = db.getMetadata().getSchema();
if (!schema.existsClass(DB_CLASS)) {
final OClass type = schema.createClass(DB_CLASS);
type.createProperty(P_TIMESTAMP, OType.LONG);
type.createProperty(P_TYPE, OType.STRING);
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);