[odb-users] View and Object from common struct

Davide Anastasia Davide.Anastasia at qualitycapital.com
Wed Sep 26 05:47:34 EDT 2012


Hi,

I am currently working on a database that stores timeseries and events.
In most cases, when I want to perform a query, I want a bunch of this
samples, in a specified order. As far as I understood, the way of doing
this is to create a view of the object with ORDER BY statement. However,
this two objects (the Event and the EventView) are essentially the same
thing.

I wonder whether anything like this is possible then:

 

struct EventData

{

std::string data1_;

int data2_;

};

 

#pragma db object

class EventObj : public EventData

{

 

};

 

#pragma db view object(EventObj)

class EventView : public EventData

{

};

 

 

Best,

 

Davide Anastasia
Analyst, Research & Development


Quality Capital Management Ltd.
QCM House * Horizon Business Village
No. 1 Brooklands Road
Weybridge * Surrey KT13 0TJ
United Kingdom

Tel: +44 (0) 1932 334 400
Fax: +44 (0) 1932 334 415
Email: Davide.Anastasia at QualityCapital.com
<mailto:Davide.Anastasia at QualityCapital.com> 

www.qualitycapital.com <http://www.qualitycapital.com/> 

________________________________

This email and any attachments are confidential and intended solely for
the use of the individual(s) to whom it is addressed. 

Any views or opinions presented are solely those of the author and do
not necessarily represent those of Quality Capital Management Ltd. If
you are not the intended recipient, be advised that you have received
this email in error and that any use, dissemination, printing,
forwarding or copying of this email is strictly prohibited. Please
contact the sender if you have received this email in error. You should
also be aware that emails are susceptible to interference and you should
not assume that the contents of this email originated from the sender
above or that they have been accurately reproduced in their original
form. Quality Capital Management Ltd is authorised and regulated by the
Financial Services Authority in the UK and is a member of the National
Futures Association in the US. 

________________________________

 



More information about the odb-users mailing list