From: Antony C. <an...@sm...> - 2006-06-16 13:29:49
|
On 16 Jun 2006, at 14:17, Matthew Buckett wrote: > Antony Corfield wrote: >> On 16 Jun 2006, at 13:49, Matthew Buckett wrote: >> >>> Antony Corfield wrote: >>>> On 16 Jun 2006, at 11:14, Matthew Buckett wrote: >>>> >>>>> Naomi Miles wrote: >>>>>> Is the event_code coupled with resource_id or something to give >>>>>> specific events? All Event subclasses have own event(s) and they >>>>>> all >>>>>> start at 1. I presume this is what ends up in Events table as >>>>>> event_code? Or am I missing something? >>>>> Yep they will. >>>>> >>>>> The event_code relates to the class. Because the Bodington database >>>>> layer will give you back a AssessmentEvent or LogBookEvent the >>>>> enumeration of event_codes is local to the event subclass. >>>> True, so public static Event findEvent( String where ) etc. will >>>> return >>>> Events for that sub class and casting will identify event_codes for >>>> that type. But what if we use JDBC to query events table - we don't >>>> have object info? >>> You have to join to the objects and classes table then you can find >>> out. >> Can't see how that would identify the type of resource in the events >> table!? > > Jon has a good background explanation of PersistentObject that should > clear up some thing > SELECT classes.java_class, events.* > FROM events, objects, classes > WHERE events.event_id = objects.id and objects.type = classes.type; Thanks Matthew, Jon, yes this is what I wanted to know i.e. events.event_id = objects.id ...there you go Naomi, pure sql will do it! SELECT classes.java_class, events.* FROM events, objects, classes WHERE java_class like 'org.bodington.server.events.SomeEvent' and events.event_id = objects.id and objects.type = classes.type; > > > -- > -- Matthew Buckett, VLE Developer > -- Learning Technologies Group, Oxford University Computing Services > -- Tel: +44 (0)1865 283660 http://www.oucs.ox.ac.uk/ltg/ > > > _______________________________________________ > Bodington-developers mailing list > Bod...@li... > https://lists.sourceforge.net/lists/listinfo/bodington-developers |