ODB 1.5.1 

I think i found the problem, on graph init I do initialization of classes 
for Edges and Vertexes, and such classes has intersections like USER, so as 
I right understand it is not possible create classes with same name for 
Edges and Vertexes? 

public enum Relationship {

USER, TAGS, PROPERTIES,

FOLDERVERSION, ITEMVERSION, //used for versioned relations 

FOLDER, ITEM, // used to store tree structure

THREAD

};


public enum ItemType {

ROOT, USER, FOLDER, BLOB, TAG, PROPERTY

 };



private void initGraph(){

OGlobalConfiguration.CACHE_LEVEL1_ENABLED.setValue(false);

OGlobalConfiguration.DB_USE_DISTRIBUTED_VERSION.setValue(false);

OGlobalConfiguration.NON_TX_RECORD_UPDATE_SYNCH.setValue(true); //Executes 
a synch against the file-system at every record operation. This slows down 
records updates but guarantee reliability on unreliable drives

OGlobalConfiguration.TX_LOG_SYNCH.setValue(true); //Executes a synch 
against the file-system for each log entry. This slows down transactions 
but guarantee transaction reliability on non-reliable drives

graph = new OrientGraph(location);

graph.getRawGraph().commit();

for (ItemType type : ItemType.values()) {

try {

graph.createVertexType(type.toString().toLowerCase(Locale.ENGLISH
)).setSuperClass(graph.getVertexBaseType());

} catch (OSchemaException e) {

logger.debug("Vertex class "+type.toString()+" already exists in current 
database", e);

}

 };

 for (Relationship type : Relationship.values()) {

try {

graph.createEdgeType(type.toString().toLowerCase(Locale.ENGLISH
)).setSuperClass(graph.getEdgeBaseType());

} catch (OSchemaException e) {

logger.debug("Edge class "+type.toString()+" already exists in current 
database", e);

}

 };

  }


понедельник, 20 января 2014 г., 14:43:30 UTC+4 пользователь Valentin Popov 
написал:
>
> Hello everybody, 
>
> Database was created on schema-less format, all vertices were inserted 
> with graph.addVertex(null), type of vertex is set on properties (like user, 
> email, etc..) right now we need convert all vertexes to  schema-hybrid 
> format. Right now all vertexes converted to schema like 
>
> public enum ItemType {
>
> ROOT, USER, FOLDER, BLOB, TAG, PROPERTY
>
> };
>
> for (ItemType type : ItemType.values()) {
>
> try {
>
> graph.createVertexType(type.toString());
>
> } catch (OSchemaException e) {
>
> logger.debug("Vertex class "+type.toString()+" already exists in current 
> database", e);
>
> }
>
> };
>
>
> and all new vertexes inserted as graph.addVertex("class:"
> +type.toString());
>
>
> Problem is when I try associate items like graph.addEdge(null, 
> parentVertex, childVertex, relationship.toString().toLowerCase(Locale.
> ENGLISH)); I get exception "The class user does not extend class 'E' and 
> therefore cannot be considered an Edge "
>
>
> Thanks for any clue 
>
>
> Regards 
>
> Valentin
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to