[odb-users] ODB version as timestamp

Paul Stath PStath at jmawireless.com
Mon Mar 25 14:56:02 EDT 2019

Is it possible in ODB to define the version attribute as a date-time stamp?
I seem to recall in a past project having the version column be a boost::posix_time::ptime value.
However, this was quite a while back, and I may be confusing it with a Java Persistence API project.

When I try to change the data type of the member variable from 'unsigned long' to 'boost::posix_time::ptime', the SQL looks fine, but I get a compilation error in the generated code.

In the <Class>::persist() method, the version value is being initialized to an integer 1.

     obj.version = 1;

I would expect it to set obj.version to the current date/time when the record is persisted.

I have other columns in the same class that are 'boost_posix_ptime' which work correctly, so I already have the '--profile boost/date-time/posix-time' flag set.

Am I trying to do something that is unsupported?

Paul Stath
Senior Software Engineer
JMA Wireless
pstath at jmawirelesss

-----Original Message-----
From: odb-users-bounces at codesynthesis.com <odb-users-bounces at codesynthesis.com> On Behalf Of odb-users-request at codesynthesis.com
Sent: Sunday, March 24, 2019 12:00 PM
To: odb-users at codesynthesis.com
Subject: odb-users Digest, Vol 103, Issue 15

Send odb-users mailing list submissions to
	odb-users at codesynthesis.com

To subscribe or unsubscribe via the World Wide Web, visit
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..."

More information about the odb-users mailing list