package com.db4o.samples;

import com.db4o.*;
import com.db4o.lib.Logger;

public class S06_Get_SubClasses
{
	public static void main(String[] args)
	{
		ObjectContainer db = Db4o.openFile("samples.yap");
		Logger.log("*** S06 Retrieving all objects of class Person");


		ObjectSet os = db.get(new Person());
		// Retrieving objects of a class also
		// retrieves objects of subclasses.
		//
		// In this example, objects of the Individual class 
		// and of the Company class are also retrieved.


		while(os.hasNext()){
			Logger.log(db, os.next());
		}
		db.close();
	}
}
