org.umlg.sqlg.groovy.plugin.SqlgH2GremlinPlugin Maven / Gradle / Ivy
package org.umlg.sqlg.groovy.plugin;
import org.apache.tinkerpop.gremlin.jsr223.AbstractGremlinPlugin;
import org.apache.tinkerpop.gremlin.jsr223.DefaultImportCustomizer;
import org.apache.tinkerpop.gremlin.jsr223.ImportCustomizer;
import org.umlg.sqlg.structure.*;
import org.umlg.sqlg.structure.topology.*;
/**
* @author Lukas Krejci
* @since 1.3.0
*/
public class SqlgH2GremlinPlugin extends AbstractGremlinPlugin {
private static final String NAME = "sqlg.h2";
private static final ImportCustomizer imports;
static {
try {
imports = DefaultImportCustomizer.build()
.addClassImports(
PropertyType.class,
RecordId.class,
SchemaTable.class,
SqlgEdge.class,
SqlgElement.class,
SqlgGraph.class,
SqlgProperty.class,
SqlgVertex.class,
SqlgVertexProperty.class,
Topology.class,
EdgeLabel.class,
VertexLabel.class,
Schema.class,
PropertyColumn.class,
Index.class,
IndexType.class,
Graph.class,
GlobalUniqueIndex.class
)
.create();
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
private static final SqlgH2GremlinPlugin instance = new SqlgH2GremlinPlugin();
public SqlgH2GremlinPlugin() {
super(NAME, imports);
}
public static SqlgH2GremlinPlugin instance() {
return instance;
}
@Override
public boolean requireRestart() {
return true;
}
}