Hi Micha,

On 02.06.09 01:29, Michael Strobel wrote:
Hi Ocke,

finally I found the reason for the problem with the table wizard. Some 
properties of the ColumnDescriptor objects (IsRowVersion, Description, 
DefaultValue) needed to have value instead of being null. This caused a null 
pointer exception in a method of the wizard, which clones the ColumnDescriptor 
objects. I couldn´t figure out why the wizard does this, but I think it´s okay 
since it works fine with our new driver now and it always worked fine with the 
embeded hsqldb :-)
Great. Do you have a patch file that we could apply into our code? :-)
Something that still doesn´t work with our new driver is keeping default values 
and descriptions for columns over sessions. I thought that OOo base stores them 
in the odb file automatically, but looks like the driver needs to do that 
itself. Before I try to dig into the code of the other OOo base drivers to find 
a solution, I just wanted to ask if you know where I could look for a sample of 
that code or if some part OOo API provides the functions to write/read these 
properties in/from odb files ;-)
We have two default values
1. "DefaultValue" and
2. "ControlDefault"

The 2nd is stored inside the odb file db:default-value. The 1st is stored inside the database. The problem now was to get the default value from the database when moving to the insert row. This wasn't possible, here ControlDefault was invited. So when you use the table designer to create a table you always insert the ControlDefault. To change for example the wizard you have to set the DefaultValue at the column descriptor. The source code for the table designer can be found in dbaccess/source/ui/tabledesign

- oj
Best regards,
Micha

-----Ursprüngliche Nachricht-----
Von: Ocke Janssen [mailto:ocke.jans...@sun.com]
Gesendet: Do 28.05.2009 01:40
An: dev@dba.openoffice.org
Betreff: Re: [dba-dev] [dev-dba] database driver problem with the table 
creation wizard
Hi Mischa,

On 28.05.09 00:58, Michael Strobel wrote:
Hi @All,

I have done a complete rewrite of our Ingres driver with the OOo SDK and Java. 
It seems to work pretty well despite two issues. I found a workaround for the 
first issue, but I could not solve the second issue yet. It´s about creating 
tables using the table creation wizard. I will describe the issue below. Maybe 
someone here has an idea what´s causes the problem. It would also be useful to 
know where the sources of the table creation wizard can be found in the 
dbaccess module, as I was not able to figure out where they are. I can log the 
method calls of the driver to a file, so I got at least some information what´s 
going on under the hood of the driver.

When the first page of the wizard is opened a new TableDescriptor object is 
created. When the next button on the first page of the wizard is clicked for 
every column, that was selected beforehand, a ColumnDescriptor object is 
created and the second page of the wizard appears. The the properties of the 
ColumnDescriptor objects are set. For some reason I don´t know these 
ColumnDescriptor objects seem not to be used with the appendByDescriptor method 
of the table object later on, but new ColumnDescriptor object are created for 
this when the next button on the second page is clicked. These new 
ColumnDescriptor object also get their properties set, with exception of the 
Name property. This causes the wizard not to finish. If I do changes to the 
column names on the second page the Name property is set correctly and the 
wizard does finish fine. Another thing that´s strange is that the 
ColumnDescriptor objects created at first seem to get their Type property set 
wrong values. For example columns that should be char columns are set to 
varchar. I am not sure if this is important since I also don´t know what these 
ColumnDescriptor objects are actually used for and as said before the whole 
thing works if I just do some changes to the column names on the second page of 
the wizard.
First of all wow. Good tracing. :-) Looks like you found a bug may be you want to write an issue and send it to me and I'll take a look at it. And/or you have to take look at the wizard itself. It is located in the wizards module. When you are familiar with Java you should have no problem at least may be a little bit with the code style. :-) I'm not that familiar with the code as well. By the way does this also happen with the embedded hsqldb? And which version of OOo do you use?

Best regards,

Ocke
Best regards,
Micha



------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org


--
Ocke Janssen                      Tel: +49 40 23646 661, x66661
Dipl. Inf(FH)                     Fax: +49 40 23646 550
Sun Microsystems Inc.
Nagelsweg 55                      mailto:ocke.jans...@sun.com
D-20097 Hamburg                   http://www.sun.com/staroffice

Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Thomas Schr?der, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Haering

Reply via email to