I agree with Kevin, the missing argument for dropDB is a bug and should be
documented in a JIRA issue. If you don't have an account I'll go ahead and
open one on your behalf.

To answer Tedman's questions :
DropDB is perhaps misnamed. I'd be very nervous about changing it to issue
drop DB ${DBNAME} on any database though ;-). I'd much rather rename it to
drop tables than change it.

The difference between the MappingTool and SchemaTool is a little subtle.
The MappingTool primarily does Top Down mapping and either executes or
generates SQL. The SchemaTool can do other things like produce an xml
representation of a database. That xml representation can then be used by
other OpenJPA tools like the Mapping or ReverseMapping tool - this could be
useful if your developer doesn't have read access to the production
database.

Over time the lines between the two (or three) tools have blurred and
there's a bit of overlapping function. It's probably a good side project to
do some analysis and cleanup, but it hasn't bubbled to the top of my list,
yet.

-mike


On Tue, Mar 10, 2009 at 10:21 AM, Tedman Leung <[email protected]> wrote:

> Incidentally, with the MappingToolTask, if you use schemaAction="dropDB",
> at least in MySql, you don't get a drop DB command, you get drop table
> commands, which sounds like what you're trying to do. I don't know if this
> applies to the schemaTool or what the difference between the MappingTool
> and SchemaTool is though.
>
> On Tue, Mar 10, 2009 at 10:12:04AM -0500, Kevin Sutter wrote:
> > Hi,
> > From what I can tell, this looks to be a blatant bug.  I can't find this
> > argument ever being implemented in past releases, but I only went back as
> > far as 1.0.x.  Please open a JIRA for this problem.
> >
> > As far as workarounds...  It depends on what your need is.  If you really
> > need to drop the tables, then you could either do it manually or use
> another
> > tool, such as the MappingTool.  Or, maybe one of the other options on
> > SchemaTool is sufficient like the actions of "deleteTableContents", or
> > "dropDB".
> >
> > Sorry for the inconvenience.
> > Kevin
> >
> > On Tue, Mar 10, 2009 at 5:37 AM, lfnoleto <[email protected]> wrote:
> >
> > >
> > > Hi,
> > >
> > > I think this is a bug. The task SchemaToolTask does not implements
> > > "dropTables" argument. According to the documentation [1] this task can
> > > take "dropTables" arguments
> > > but when I run as shown below I get this error: The <schematool> type
> > > doesn't support the "droptables" attribute.
> > >
> > >    <schematool dropTables="true" action="retain">
> > >            <fileset dir="${build.sql.dir}">
> > >                <include name="schema.xml" />
> > >            </fileset>
> > >            <config
> > > propertiesFile="${prototype.src.model.base}/META-INF/persistence.xml"
> />
> > >        </schematool>
> > >
> > > In fact, I looked in source code and this task has no set method for
> > > "dropTables"argument.
> > >
> > >
> > > Does anyone know why? or any way to work around it?
> > >
> > > I use :
> > > revision.number=422266:683325
> > > openjpa.version=1.2.0
> > >
> > > [1]
> > >
> > >
> http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/ref_guide_schema_schematool.html
> > >
> > > Thanks,
> > >
> > >
> > > --
> > > View this message in context:
> > >
> http://n2.nabble.com/OpenJPA-1.2.0%3A-SchemaToolTask-does-not-have-%22dropTables%22-argument-tp2454421p2454421.html
> > > Sent from the OpenJPA Users mailing list archive at Nabble.com.
> > >
>
> --
>                                                           Ted Leung
>                                                           [email protected]
>
> It's time for a new bike when the bulb in your shift light burns out.
>

Reply via email to