internal void Update <T>(T obj) { DictionaryOrientDBEntity document; if (obj is OrientDBEntity) { document = (obj as OrientDBEntity).ToDictionaryOrientDBEntity(); } else { document = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj); } if (!string.IsNullOrEmpty(document.OClassName)) { Class(document.OClassName); } if (document.ORID != null) { Record(document.ORID); } Set(document); }
internal void Delete <T>(T obj) { DictionaryOrientDBEntity document; if (obj is OrientDBEntity) { document = (obj as OrientDBEntity).ToDictionaryOrientDBEntity(); } else { document = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj); } if (!string.IsNullOrEmpty(document.OClassName)) { Class(document.OClassName); } else { throw new OrientDBException(OrientDBExceptionType.Query, "Document doesn't contain OClassName value."); } if (document.ORID != null) { // check if the @rid is correct in real example Where("@rid"); Equals(document.ORID); } }
public IOCreateEdge Edge <T>(T obj) { DictionaryOrientDBEntity document; if (obj is OrientDBEntity) { document = (obj as OrientDBEntity).ToDictionaryOrientDBEntity(); } else { document = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj); } string className = document.OClassName; if (typeof(T) == typeof(Edge)) { className = "E"; } else if (string.IsNullOrEmpty(document.OClassName)) { throw new OrientDBException(OrientDBExceptionType.Query, "Document doesn't contain OClassName value."); } _sqlQuery.Edge(className); _sqlQuery.Set(document); return(this); }
public IOCreateDocument Document <T>(T obj) { if (obj is OrientDBEntity) { _document = (obj as OrientDBEntity).ToDictionaryOrientDBEntity(); } else { _document = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj); } return(this); }
public IOCreateEdge Set <T>(T obj) { var document = obj is OrientDBEntity ? obj as DictionaryOrientDBEntity : OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj); // TODO: go also through embedded fields foreach (KeyValuePair <string, object> field in document.Fields) { // set only fields which doesn't start with @ character if ((field.Key.Length > 0) && (field.Key[0] != '@')) { Set(field.Key, field.Value); } } return(this); }
public IOCreateVertex Vertex <T>(T obj) { if (obj is OrientDBEntity) { _document = (obj as OrientDBEntity).ToDictionaryOrientDBEntity(); } else { _document = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj); } if (string.IsNullOrEmpty(_document.OClassName)) { throw new OrientDBException(OrientDBExceptionType.Query, "Document doesn't contain OClassName value."); } return(this); }
private static OrientDBEntity ToODocument <T>(T obj) { DictionaryOrientDBEntity document; if (obj is IDictionary <string, object> ) { document = obj as DictionaryOrientDBEntity; } else { document = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj); } if (document.ORID == null) { throw new OrientDBException(OrientDBExceptionType.Query, "Document doesn't contain ORID value."); } return(document); }
public OSqlDeleteEdge To <T>(T obj) { DictionaryOrientDBEntity document; if (obj is OrientDBEntity) { document = (obj as OrientDBEntity).ToDictionaryOrientDBEntity(); } else { document = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj); } if (document.ORID == null) { throw new OrientDBException(OrientDBExceptionType.Query, "Document doesn't contain ORID value."); } _sqlQuery.To(document.ORID); return(this); }
internal void Set <T>(T obj) { DictionaryOrientDBEntity document; if (obj is OrientDBEntity) { document = (obj as OrientDBEntity).ToDictionaryOrientDBEntity(); } else { document = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj); } // TODO: go also through embedded fields foreach (KeyValuePair <string, object> field in document.Fields) { // set only fields which doesn't start with @ character if ((field.Key.Length > 0) && (field.Key[0] != '@')) { Set(field.Key, field.Value); } } }
public IOCreateVertex Vertex <T>(T obj) { DictionaryOrientDBEntity document; if (obj is OrientDBEntity) { document = obj as DictionaryOrientDBEntity; } else { document = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj); } if (string.IsNullOrEmpty(document.OClassName)) { throw new OrientDBException(OrientDBExceptionType.Query, "Document doesn't contain OClassName value."); } _sqlQuery.Vertex(document.OClassName); _sqlQuery.Set(document); return(this); }
public IOCreateEdge From <T>(T obj) { _source = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj).ORID; return(this); }
public IOCreateEdge To <T>(T obj) { _dest = OrientDBEntityExtensions.ToDictionaryOrientDBEntity(obj).ORID; return(this); }