[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: How to query for an object?



On Mon, 30 Oct 2000, Neil Aggarwal wrote:
> Falko:
> 
> So, once I put an object into the database, how do I get it back?
> 
> I saw the getObjectsOfClass method, but that is not yet implemented.
> 
> I see that I can get an object from its name, but that is not
> sufficient since I want more than one object.
> 
> Maybe a little more explanantion would help me to understand
> what you are talking about.

After retrieving the object from the database (actually a proxy for the object):

	DatabaseClass1 o1 = (DatabaseClass1)database.objectForName("root");

You can access this object and all database objects that this object may link
to via simple Java code:

	o.doSomething();

	DatabaseClass2 o2 = o.retrieveObjectThatMatchesCertainCriteria();

	o2.print();

(where o1 and o2 are objects that are actually living inside the server)

Neil, did you try out the samples that come with ozone? They may help you to
get a feeling for the possibilities of ozone.


Falko

> 
> Thanks,
> 	Neil.
> 
> --
> Neil Aggarwal, President & CEO
> JAMM Consulting, Inc. -- (972) 612-6056, http://www.JAMMConsulting.com
> Custom Programming in Java, C++, HTML, perl
> 
> On Mon, 30 Oct 2000, Falko Braeutigam wrote:
> 
> > On Sun, 29 Oct 2000, Neil Aggarwal wrote:
> > > Hello:
> > > 
> > > I am just staring with Ozone and am trying to figure out how 
> > > to do this:
> > > 	I have many objects for a given class, but I want
> > > 	to retrieve a subset of instances that match a 
> > > 	certain criterion.
> > > 
> > > How would I do this in Ozone?
> > > 
> > > I have looked thru all of the examples and the tutorial and
> > > they dont address how to do something like this.
> > 
> > >From the ozone doc (Design Goals/Architecture):
> > 
> > "ozone does not introduce a new type system, object or computation model like
> > relational DBMSs and ODMG/OQL does. ozone just lets you work with persistent
> > Java objects in a transactional environment. ozone is Java! No other types than
> > Java types, no other query/update language than Java, no impedance mismatch!"
> > 
> > In other words: Java is the "native" query language of ozone.
> > 
> > However, a descriptive query lang could be of benefit even for an OODBMS. But
> > IMHO such a query lang should provide a real OO interface (in contrast to OQL,
> > which introduces all the problems of SQL and adds some new ones). There was a
> > discussion about S.O.D.A. (Simple Object Database Access: real OO query system)
> > here on the list but unfortunately we stuck with this effort.
> > 
> > 
> > Falko
> > -- 
> > ______________________________________________________________________
> > Falko Braeutigam                              mailto:falko@smb-tec.com
> > SMB GmbH                                        http://www.smb-tec.com
> >
-- 
______________________________________________________________________
Falko Braeutigam                              mailto:falko@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com