----- Original Message -----
From: Herv� Guidetti <[EMAIL PROTECTED]>
To: Turbine <[EMAIL PROTECTED]>
Sent: Tuesday, August 01, 2000 11:46 AM
Subject: Re: How to build my own Map Builder


> OK, thanks. It works.
> I have some remarks.
>
> 1. It seems that there is a bug in the *OMGenerator : I have a table in
> which the key is a VARCHAR. So in Turbine the key is a String. In the
> generated MyTablePeer, the buildCriteria method has :
>                                 if (obj.getMyKey() > 0 )        // doesn't
> compile
> but is should be        if (obj.getMyKey() != null)
> in case of the key is a String.

Probably not a good assumption that keys will be numeric, but I think in 90%-plus
cases this will work.  The remainder is small enough to edit by hand.

> 2. I generate the OM layer with the new JDBCOMGenerator. Everything works
> and that's really cool. But... I would like to be able to regenerate this
> layer (if there are some changes made in the DB). So, I extend the MyTable
> object and add methods to MyAppMyTable. By this way, I can remplace the old
> layer with the new one. But I have to modify the code in the
> MyTablePeer.doSelect(Criteria c). Because this method returns a Vector of
> MyTable object and not of MyAppMyTable objects. So I can't regenerate the
> layer without work.
> So my question is : has anyone already resolve this problem ? If yes, how ?
> If no, do you generate the layer once, modify the code and never regenerate
> the layer ?

We (opticode software) usually tend to put a lot of effort in our database design
so the changes are kept to a minimum.  If you make any changes you can edit the
original generated om classes by hand or regenerate the whole lot. The former is
preferable if you added custom methods or attributes to your classes and the later
if you haven't added any extension to the classes.   Might be worthwhile to be
able to handle changes better later on, but to be honest at the moment it is not
really a priority for me :-)

> I saw that there is a prefix parameter in the build.xml. Isn't it the
> solution to resolve my problem ? (in this example would be MyApp)

The prefix parameter is there so that table names can be converted to more
meaningful class names.  For example in Scarab all table names start with
"SCARAB_" If you then set prefix to "SCARAB_" all the prefixes will be chopped of
the table names to create better looking class names.

> thanks
>
> Herv�
>
>
> ----- Original Message -----
> From: Leon Messerschmidt <[EMAIL PROTECTED]>
> To: Turbine <[EMAIL PROTECTED]>
> Sent: Monday, July 31, 2000 9:02 PM
> Subject: Re: How to build my own Map Builder
>
>
> > Hi,
> >
> > > Excuse me. In fact, it calls the doBuild() method but the
> > > ColumnMap[] columnMaps =
> tempDbMap.getTable( tables.get(i) ).getColumns();
> > > line generate the null pointer exception.
> > >
> > > It comes from the tempDBMap.getTable("mytablename"); This retruns null.
> > > Why, but why  ?   :-)
> > >
> >
> > JDBCMapBuilder is an old utility and you shouldn't use it anymore.  It is
> now part
> > of the *OMGenerator classes and it has been renamed to JDBCOMGenerator.
> You need
> > to download the newest version from the turbine website. Look in the
> > org.apache.turbine.tools package.
> >
> > ~ Leon
> >
> > ps It might change once again when Jason's Torque classes gets a bit
> further so
> > keep an eye on the mailing list.
> >
> >
> >
> > ------------------------------------------------------------
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> > Problems?:           [EMAIL PROTECTED]
> >
>
>
>
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?:           [EMAIL PROTECTED]
>




------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to