Hi Stefan,

> I want to add a new QueryDefinition to the DefenitionContainer. It's an
> example from the OOo Developer Guide (12.2.2 DataSources - Adding and
> Editing Predefined Queries)
> 
> The Method createQuerydefinition() which I'm using is one-to-one from
> the CodeSamples.java (see code below)
> 
> The Problem is that the last-but-one command returns null (=> the xStore
> variable is null).

Those last two lines look like nonsense, the query container is not
storable. At the very moment you do an insertByName, the query is part
of the query container.
However, for persistence of your change, you need to store the *database
document*, which in fact has the XStorable interface (I suppose this is
where the XStorable in the example wrongly came from). For this, query
the data source for XDocumentDataSource, obtain the document, and ask it
for its XStorable interface.

Could you please write an issue for this bug in the DevGuide and assign
it to me ([EMAIL PROTECTED])? Thanks.

> I have read in the api reference that XSingleServiceFactory is
> deprecated and it is recommended to use the XSingleComponentFactory
> instead.

Deprecation doesn't mean all implementations using it are already
migrated. (I'm not even sure the deprecation is meant for the particular
way how we use the interface here, but that might be another story.) It
just means that you are encouraged to use the new interface if it's
present - but here it isn't. So, just stick with the
XSingleServiceFactory, and everything should be fine :)

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to