Serialize subclasses recursively in PostgreSQL db??

Поиск
Список
Период
Сортировка
Искать

Serialize subclasses recursively in PostgreSQL db??

От:
glos@gmx.net (Gerben)
Дата:
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.
FAQ