Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[ANN] ODB C++ ORM 1.6.0 released, adds support for object ..

 
   Database Help (Home) -> mySQL RSS
Next:  Alphabetic pick list using self join and portal  
Author Message
Boris Kolpackov

External


Since: Oct 04, 2011
Posts: 2



(Msg. 1) Posted: Tue Oct 04, 2011 6:45 am
Post subject: [ANN] ODB C++ ORM 1.6.0 released, adds support for object projections
Archived from groups: comp>databases>mysql (more info?)

Hi,

I am pleased to announce the release of ODB 1.6.0.

ODB is an open-source object-relational mapping (ORM) system for C++. It
allows you to persist C++ objects to a relational database without having
to deal with tables, columns, or SQL and without manually writing any of
the mapping code.

The major new feature in this release is the introduction of the view
concept. A view is a light-weight, read-only projection of one or more
persistent objects or database tables or the result of a native SQL query
execution.

Views can be used to load a subset of data members from objects or columns
from database tables, execute and handle results of arbitrary SQL queries,
including aggregate queries, as well as join multiple objects and/or
database tables using object relationships or custom join conditions.

For example, given this persistent class:

#pragma db object
class person
{
...

#pragma db id auto
unsigned long id_;

std::string first_, last_;
unsigned short age_;
};

We can define a view that returns the number of people stored in the
database:

#pragma db view object(person)
struct person_count
{
#pragma db column("count(" + person::id_ + ")")
std::size_t count;
};

And then use this view to find out how many people are younger than 30:

typedef odb::query<person_count> query;
typedef odb::result<person_count> result;

result r (db.query<person_count> (query::age < 30));
cout << r.begin ()->count << endl;

Other important new features in this release are:

* Support for the NULL semantics and the odb::nullable container.

* Support for the boost::optional container (mapped to columns
with NULL values).

* Support for deleting persistent objects using query expressions.

* Support for storing BLOB data as std::vector<char>.

A more detailed discussion of these features can be found in the following
blog post:

http://www.codesynthesis.com/~boris/blog/2011/10/04/odb-1-6-0-released/

For the complete list of new features in this version see the official
release announcement:

http://www.codesynthesis.com/pipermail/odb-announcements/2011/000007.html

ODB is written in portable C++ and you should be able to use it with any
modern C++ compiler. In particular, we have tested this release on GNU/Linux
(x86/x86-64), Windows (x86/x86-64), Mac OS X, and Solaris (x86/x86-64/SPARC)
with GNU g++ 4.2.x-4.6.x, MS Visual C++ 2008 and 2010, and Sun Studio 12.
The currently supported database systems are MySQL, SQLite, and PostgreSQL.
This release has also been tested with the recently released PostgreSQL 9.1.

More information, documentation, source code, and pre-compiled binaries are
available from:

http://www.codesynthesis.com/products/odb/

Enjoy,
Boris

 >> Stay informed about: [ANN] ODB C++ ORM 1.6.0 released, adds support for object .. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
ALTER TABLE MODIFY adds duplicate keys - Hello! I have a weird problem... The application I use issues this SQL from time to time: alter table t modify id int(6) unique not null auto_increment; The problem is that this SQL adds a key on id every time it is run! mysql> show keys; ..

Best way to issue hundreds of inserts/updates??? - Using mysql 4.0.23- What is the best way to execute several (hundreds of) inserts and updates? Rather than issuing tons of individual inserts and updates, can I send the strings to a text file and then have mysql do them all?? IE : query.txt insert..

MySQL freezes, brings XP machine to a grinding halt - I've been using MySQL for a while for fairly light database development on my XP machine. Currently, I am just starting a new project and have experienced some big problems with MySQL today both on my office machine and at home where running a particular...

login as user 'root' but do not have root privlages and my.. - Hi gang: I'm experiencing a problem with MySQL -- I updated MySQL from version 4.1.0 to 4.1.10 and now when I login as root it doesn't show all the databases I should have access to, nor it doesn't recognize me being logged in as root (via..

FLUSH TABLES hangs if table is locked - Using FLUSH TABLES via the C query API mysql_query() hangs if the table is locked already. That is to say, nothing prevents me from running a LOCK TABLES twice; it won't tell me "it's already locked, don't try to run a FLUSH". Anyone know ...
   Database Help (Home) -> mySQL All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]