[odb-users] Problem with pointer in base class

Ball, John R jrball at sandia.gov
Wed Jul 3 10:46:40 EDT 2013


I am working on a prototype to replace an existing home-grown DB back end with PGSQL and ODB. Our design includes a structure that I'm having a hard time implementing. Consider a base class Foo that references another base class Bar by pointer. The pointer is held by the Foo base and is instantiated on the Bar base class. We now want to have parallel specialization hierarchies for Foo and Bar. When we store Foo and Bar specializations, they of course go into individual tables. However, since the pointer is held by the Foo base class and instantiated on the Bar base class, ODB can't find the Bar specialization objects to resolve the pointer.

The exact symptom is that I when call persist(my_foo), the code throws a foreign key constraint error because Bar key=n is not present in table Bar. This is true since the object isn't in the Bar table it is in the Bar specialization table. I need to know how to tell a Foo specialization to use a Bar specialization pointer so that persist works. Any help would be appreciated.


==========
John R. Ball - CISSP
Sandia National Laboratories, Albuquerque NM
Organization 5541 - Data Systems IA Lead Engineer
Phone: (505) 844-1356
Pager: (505) 951-6328
Bldg 752/122 MS 0975
E-Mail: jrball at sandia.gov<mailto:jrball at sandia.gov> <mailto:jrball at sandia.gov>
==========



More information about the odb-users mailing list