Serialize subclasses recursively in PostgreSQL db?? - Mailing list pgsql-general

From glos@gmx.net (Gerben)
Subject Serialize subclasses recursively in PostgreSQL db??
Date
Msg-id 7129be4a.0201100244.2eff1032@posting.google.com
Whole thread Raw
List pgsql-general
Hello,

i have the following problem:

I want to store an instance of a class, including it's subclass in a
PostgreSQL database. Does anybody have a sollution for this (see
example beneath)?????

Example:
______________________________________________
Class 1:
--------
public class Test implements java.io.Serializable
{
    public String value;
    public SubTest b;
    public int oid = 0;

    public Test()
    {
        value = "init";
        b = new SubTest();
    }

    public String getValue()
    {
        return value;
    }
}
_________________________________________________
Class 2:
--------
public class SubTest implements java.io.Serializable
{
    public String value;
    public int oid = 0;

    public SubTest()
    {
        value = "string subtest";
    }

    public String getValue()
    {
        return value;
    }
}
__________________________________________________

I adjusted Serializa.java that it sees the SubClass, and storing this
one is no problem, BUT storing the oid of Test afterwards is giving me
troubles.

Does anyone know a sollution? Thanxs, you can help me a lot with it.

G.

pgsql-general by date:

Previous
From: ph02116@yahoo.com (ph01803)
Date:
Subject: Having problem with initdb on my Solaris 8 box
Next
From: Justin Clift
Date:
Subject: Re: Kindly help.