Your code should look something more like the following. Please note it is assumed the Connector is connected to an appropriate Broker, the database connection is active and that the database schema has been created (you can do the later step from Model Explorer quite easily).
var
Band : TBand;
begin
// Query the database for all TCountry instances or descendants
CountrySelector.Close;
CountrySelector.Command.Text := 'SELECT * FROM ANY TCountry';
CountrySelector.Open;
if ContactSelector.ObjectCount > 0 then
begin
Band := TBand.Create(Connector);
try
// Take currently selected Country and assign to Band's Country property
// Reference counting is handled automatically
Band.Country := CountrySelector.CurrentObject as TCountry;
Band.Store;
finally
Band.Free; // Free reference to Band so we do not leak an object
end;
end;
end;
I should also mention that I do not use Selector very often since it does not address my typical application requirements. My users often retrieve 20k+ records from Firebird at a whack using DevExpress Quantum grids and expect response times consistently under 2 seconds. To meet this requirement took some very careful design and tuning using IBExpert (a quirky but otherwise excellent tool) since my queries often span many tables and have complex filtering requirements.
What I can say about IO is that it makes data modeling easy since the design is reduced to a point and click process using Model Explorer. IO is also a good data binding framework since it allows you to "Expose" even complex object graphs as data sets and bind the properties to visual controls. The other part I like is that I no longer need to fuss with manually creating insert or update queries and setting column values to add or modify persistent objects. IO does this and more for you behind the scenes with very little coding.
David