[odb-users] Re: odb-users Digest, Vol 47, Issue 12

Murray Wilson murray.wilson at gmail.com
Thu Jul 24 14:20:15 EDT 2014


When talking about the schema I was referring to the "database
namespace". In the meantime I checked the manual on this and it looks
like ODB supports only a single schema. That is, there is no ODB way
of issuing a "alter session set current_schema = xyz". Is this
correct?

Databse Schema are covered in the ODB manual in section 14.1.8:
http://www.codesynthesis.com/products/odb/doc/manual.xhtml#14.1.8

"In ODB, a schema for a table of a persistent class can be specified
at the class level, C++ namespace level, or the file level. To assign
a schema to a specific persistent class we can use the schema
specifier, for example:
#pragma db object schema("accounting")
class employee
{
  ...
};
If we are also assigning a table name, then we can use a shorter
notation by specifying both the schema and the table name in the table
specifier:

#pragma db object table("accounting.employee")
class employee
{
  ...
};

If we want to assign a schema to all the persistent classes in a C++
namespace, then, instead of specifying the schema for each class, we
can specify it once at the C++ namespace level. For example:

#pragma db namespace schema("accounting")
namespace accounting
{
  #pragma db object
  class employee
  {
    ...
  };

  #pragma db object
  class employer
  {
    ...
  };
}
If we want to assign a schema to all the persistent classes in a file,
then we can use the --schema ODB compiler option. For example:

odb ... --schema accounting ...

An alternative to this approach with the same effect is to assign a
schema to the global namespace:

#pragma db namespace() schema("accounting")"

On Thu, Jul 24, 2014 at 12:00 PM,  <odb-users-request at codesynthesis.com> wrote:
> Send odb-users mailing list submissions to
>         odb-users at codesynthesis.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://codesynthesis.com/mailman/listinfo/odb-users
> or, via email, send a message with subject or body 'help' to
>         odb-users-request at codesynthesis.com
>
> You can reach the person managing the list at
>         odb-users-owner at codesynthesis.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of odb-users digest..."
>
>
> Today's Topics:
>
>    1. shared pointers to abstract classes (first last)
>    2. Is there an API documentation? (Marcel Nehring)
>    3. Re: shared pointers to abstract classes (Boris Kolpackov)
>    4. Re: Is there an API documentation? (Boris Kolpackov)
>    5. AW: [odb-users] Is there an API documentation? (Marcel Nehring)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 23 Jul 2014 18:12:30 -0700
> From: first last <armz4pxq at gmail.com>
> Subject: [odb-users] shared pointers to abstract classes
> To: odb-users at codesynthesis.com
> Message-ID:
>         <CAMzAyxtsNeU_p6XZ75eoYLHkdsrhYTQ=K_PCDP=_Hd8CHKV3xw at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hi Boris,
>
>
> I have a very basic question.
>
> How can I make persistent a class that has as a member a pointer to an
> abstract class.
>
> Something like:
>
>
> class person {
>
> ... abstract
>
> }
>
>
> class operator : public person {
>
> ... real
>
> }
>
>
> class programmer : public person {
>
> ... real
>
> }
>
>
> class employer {
>
>     shared_ptr<person> employee;  // this can be either an operator or a
> programmer
>
> }
>
>
> Thanks,
>
>
> Dan
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 24 Jul 2014 08:37:54 +0000
> From: Marcel Nehring <mne at qosmotec.com>
> Subject: [odb-users] Is there an API documentation?
> To: "odb-users at codesynthesis.com" <odb-users at codesynthesis.com>
> Message-ID: <ea97df2ccc774dfc9d2cb52dbf31e85c at QEX.qosmotec.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hello,
>
> I started to work with ODB and was wondering if there is any lightweight API documentation like a doxygen page or similar. The only documentation I could find is the ODB manual, which is quite detailed and exhaustive but it is also quite hard to use when looking for a specific feature or description of a method parameter and stuff like this. A simple API documentation which lists the classes, methods etc. and gives a brief explanation would be very helpful here.
> For example I am working with Oracle and I could not find a method to specify the schema I want to use nor one to query for the currently used schema.
>
> Regards,
>                 MNE
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 24 Jul 2014 12:20:31 +0200
> From: Boris Kolpackov <boris at codesynthesis.com>
> Subject: Re: [odb-users] shared pointers to abstract classes
> To: first last <armz4pxq at gmail.com>
> Cc: odb-users at codesynthesis.com
> Message-ID: <boris.20140724121910 at codesynthesis.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Dan,
>
> first last <armz4pxq at gmail.com> writes:
>
>> How can I make persistent a class that has as a member a pointer to an
>> abstract class.
>>
>> class employer {
>>
>>     shared_ptr<person> employee;  // this can be either an operator or a programmer
>>
>> }
>
> By using polymorphic inheritance (Section 8.2 in the manual).
>
> Boris
>
>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 24 Jul 2014 12:27:13 +0200
> From: Boris Kolpackov <boris at codesynthesis.com>
> Subject: Re: [odb-users] Is there an API documentation?
> To: Marcel Nehring <mne at qosmotec.com>
> Cc: "odb-users at codesynthesis.com" <odb-users at codesynthesis.com>
> Message-ID: <boris.20140724122045 at codesynthesis.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Marcel,
>
> Marcel Nehring <mne at qosmotec.com> writes:
>
>> I started to work with ODB and was wondering if there is any lightweight
>> API documentation like a doxygen page or similar. The only documentation
>> I could find is the ODB manual, which is quite detailed and exhaustive
>> but it is also quite hard to use when looking for a specific feature or
>> description of a method parameter and stuff like this. A simple API
>> documentation which lists the classes, methods etc. and gives a brief
>> explanation would be very helpful here.
>
> No, unfortunately there is no such thing. The best alternative for this
> is probably to just open the header. Most of the functions/argumets/etc
> in there should be self-explanatory.
>
>
>> For example I am working with Oracle and I could not find a method
>> to specify the schema I want to use nor one to query for the currently
>> used schema.
>
> Not sure what you mean by "schema" in the Oracle content. It could mean
> the "database namespace" (Section 14.1.8) or the "statements that create
> tables/etc" (Section 3.4 and Chapter 13).
>
> Boris
>
>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 24 Jul 2014 10:51:45 +0000
> From: Marcel Nehring <mne at qosmotec.com>
> Subject: AW: [odb-users] Is there an API documentation?
> To: "odb-users at codesynthesis.com" <odb-users at codesynthesis.com>
> Message-ID: <bfdc0a59b40b461f9a940265f14786cf at QEX.qosmotec.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi Boris,
>
> that's a pity. I think it would be a great help to have something like this around for a quick reference. Might we have it available somewhere in the future?
>
> When talking about the schema I was referring to the "database namespace". In the meantime I checked the manual on this and it looks like ODB supports only a single schema. That is, there is no ODB way of issuing a "alter session set current_schema = xyz". Is this correct?
>
> Regards,
> Marcel
>
>
>
> ------------------------------
>
> _______________________________________________
> odb-users mailing list
> odb-users at codesynthesis.com
> http://codesynthesis.com/mailman/listinfo/odb-users
>
>
> End of odb-users Digest, Vol 47, Issue 12
> *****************************************



More information about the odb-users mailing list