The following will show Vertices from Mysubclass only: select from Mysubclass
The following will show Vertices from Person and all subclasses of Mysubclass. select from Person In either query result, you will see all of the properties of each vertex. Class inheritance will inherit defined properties but it doesn't sound like you have actually defined any properties (just added property values to vertices). For this you need to use the "create property" SQL command. You can execute it from the Java API but there isn't a method in the API such as graph.createProperty(String vclass,String propertyName, etc.). See the following for more details: http://orientdb.com/docs/last/SQL-Create-Property.html On Thursday, August 4, 2016 at 2:25:41 AM UTC-4, Varun Tahin wrote: > > I have a graph created in which i want to impose an inheritance model . > As a sample code I am defining superclass and subclass doing somewhat like > this: > > OrientGraph graph = new OrientGraph("remote:/localhost/newhilti", "root", > "varun"); > graph.createVertexType("Mysubclass", "Person"); > > in this I have already made a Person class(superclass for Mysubclass) > which is containing some properties and I am defining some other distinct > properties for Mysubclass too like this: > > Vertex vPerson = graph.addVertex("class:Mysubclass"); > vPerson.setProperty("firstName", "John"); > vPerson.setProperty("lastName", "Smith"); > graph.commit(); > > Now I cannot see the properties which are in Person class when I query > Mysubclass. Are they not inherited properly or I am missing some link . > Please suggest. > > Thanks- > Varun Tahin > -- --- 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/d/optout.
