I don't disagree.  Normally, I would not expect a RDB request to return 
this information but due to orientdb's polymorphism capabilities I think it 
would be reasonable.  As my schema is not static, I cannot rely on a java 
object to determine a class' ancestors; new sub classes will be defined 
during run time.

On Friday, July 31, 2015 at 2:50:33 PM UTC-4, hartmut bischoff wrote:
>
> Hi,
>
> in my view, thats not the job of a database-request. Instead its a matter 
> of your OOP-Design.
>
> I thought, even Java has basic OOP-Support.
> So why do you not assign the retrieved Class to the proper Java-Object?
>
> I have done this for ruby. There its just a matter of two lines of code:
>     def self.orientdb_class name
>        klass = Class.new( self )
>        name =  name.to_s.camelize
>        if self.send :const_defined?, name
>           self.send :const_get, name  # returns the Const
>        else
>           self.send :const_set  , name , klass  # creates and returns the 
> Const
>          end
>    end
>
>
> Elsewhere you simply define the Class in the usual way. Everytime a 
> Database-object is fetched, I call BaseClass.orientdb_class( vertex_name ) 
>  and get the proper Ruby-class. 
> The ruby-class knows about its parents and has the proper methods to deal 
> with the fetched content.
> Take a look at ActiveOrient
>
> Maybe its not that simple in Java, but as Jruby exists, somehow it must 
> work.
>
> On Friday, July 31, 2015 at 12:59:00 AM UTC+2, Chris Whalen wrote:
>>
>> Has anyone figured out how to return the parent classes of a vertex as a 
>> projection?  When I get the vertex, I need to know what it's parent classes 
>> are.  So if I get a Square classed vertex, I need to know that it is of a 
>> sub class of Rectangle and Shape.
>>
>>
>>

-- 

--- 
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.

Reply via email to