You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Martin Poeschl <mp...@marmot.at> on 2003/02/10 12:13:24 UTC
separate torque generator
i want to separate torque's generator from the runtime environment
here's the plan:
o move all generator stuff to /src/generator
(incl. dtd, templates, maven-plugin, ...)
o maven build for the generator
o adopt the runtime tests to use the torque-gen.jar
o move the generator related xdocs to src/generator/xdocs
maybe we can use the generator as basis for a more general generator
we could also switch to use commons-sql for the sql-generation
i'll add a PRE_GENERATOR tag to the repo before i'll checkin the changes
martin
Re: separate torque generator
Posted by Stephen Haberman <st...@beachead.com>.
On Mon, Feb 10, 2003 at 12:13:24PM +0100, Martin Poeschl wrote:
> i want to separate torque's generator from the runtime environment
>
> here's the plan:
>
> o move all generator stuff to /src/generator
> (incl. dtd, templates, maven-plugin, ...)
>
> o maven build for the generator
>
> o adopt the runtime tests to use the torque-gen.jar
>
> o move the generator related xdocs to src/generator/xdocs
Very nice, Martin.
- Stephen
Re: separate torque generator
Posted by Jason van Zyl <ja...@zenplex.com>.
On Mon, 2003-02-10 at 10:54, Neeme Praks wrote:
> http://www.mail-archive.com/commons-dev%40jakarta.apache.org/msg17116.html
>
> No reaction on commons-dev....
Because we're moving it all over to db.apache.org when it's there then
we hope to spark up discussions.
> James Strachan wrote:
> >
> > How about this?
> >
> > http://jakarta.apache.org/commons/sandbox/sql/index.html
> >
> > James
> > -------
> > http://radio.weblogs.com/0112098/
> > __________________________________________________
> > Do You Yahoo!?
> > Everything you'll ever need on one web page
> > from News and Sport to Email and Music Charts
> > http://uk.my.yahoo.com
> >
--
jvz.
Jason van Zyl
jason@zenplex.com
http://tambora.zenplex.org
In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
-- Jacques Ellul, The Technological Society
Re: separate torque generator
Posted by James Strachan <ja...@yahoo.co.uk>.
From: "Neeme Praks" <ne...@apache.org>
> http://www.mail-archive.com/commons-dev%40jakarta.apache.org/msg17116.html
>
> No reaction on commons-dev....
Despite the lack of reaction, I'm +1 on such a thing.
It should be pretty trivial to get started too - just populate the existing
commons-sql beans into Jelly or Velocity and implement the code generation
that way. I've already got a had-crafted version of this on a project (that
generatest beans & OJB mappings file) that I've been hoping to get the
cycles to rip out and add to commons-sql. But really all it does is use the
commons-sql model to code generate some Java code - much like Torque does -
but in a generic way so that code for any persistence mechanism can be
generated.
James
-------
http://radio.weblogs.com/0112098/
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
Re: separate torque generator
Posted by Neeme Praks <ne...@apache.org>.
http://www.mail-archive.com/commons-dev%40jakarta.apache.org/msg17116.html
No reaction on commons-dev....
James Strachan wrote:
>
> How about this?
>
> http://jakarta.apache.org/commons/sandbox/sql/index.html
>
> James
> -------
> http://radio.weblogs.com/0112098/
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
>
Re: separate torque generator
Posted by Neeme Praks <ne...@apache.org>.
I updated that page a bit with some of my ideas on OQL and object
factories...
Also, I started to check out the decoupled torque generator... I managed
to build the JAR file, but I have some questions:
* docs mention build-torque.xml Ant script, but i cannot seem to find it
from anywhere... (I have the old version, but I would like to get a
newer copy...)
* OJB generator has a bunch of templates like these:
Control.vm
ExtensionInterface.vm
ExtensionObject.vm
ExtensionProxyInterface.vm
Interface.vm
Object.vm
ProxyInterface.vm
What are they all used for?
I understand that I would probably like to generate an interface and a
simple implementation (and possibly an extension to both of these), but
what are the rest (proxy stuff)?
Also, I would like to be more in control over the resulting class names.
Right now it generates something along the lines:
${basePrefix}${table.JavaName}Interface
I would be interested in making this a configurable pattern that could
use variable substitution on the fly.
So, instead of
com.acme.om.BaseUser (base class)
com.acme.om.User (extension class)
com.acme.om.BaseUserInterface (base interface)
com.acme.om.UserInterface (extension interface)
I could have for example this:
com.acme.om.base.UserImpl (base class)
com.acme.om.UserImpl (extension class)
com.acme.om.base.User (base interface)
com.acme.om.User (extension interface)
How about that?
Anybody else interested?
Neeme
Martin Poeschl ::
> Martin Poeschl wrote:
>
>> i'll start a wiki page ... so people can add what they want the
>> generator to do ..
>>
>> martin
>
>
> http://nagoya.apache.org/wiki/apachewiki.cgi?DbGenerator
>
>
RE: separate torque generator
Posted by Paulo Gaspar <pa...@krankikom.de>.
What about this generic generator?
http://boss.bekk.no/boss/middlegen/
have fun,
Paulo Gaspar
> -----Original Message-----
> From: Martin Poeschl [mailto:mpoeschl@marmot.at]
> Sent: segunda-feira, 10 de Fevereiro de 2003 16:33
> To: general@db.apache.org
> Subject: Re: separate torque generator
>
>
> Martin Poeschl wrote:
>
> > i'll start a wiki page ... so people can add what they want the
> > generator to do ..
> >
> > martin
>
> http://nagoya.apache.org/wiki/apachewiki.cgi?DbGenerator
>
Re: separate torque generator
Posted by Martin Poeschl <mp...@marmot.at>.
Martin Poeschl wrote:
> i'll start a wiki page ... so people can add what they want the
> generator to do ..
>
> martin
http://nagoya.apache.org/wiki/apachewiki.cgi?DbGenerator
Re: separate torque generator
Posted by Martin Poeschl <mp...@marmot.at>.
James Strachan wrote:
>>Martin Poeschl ::
>>
>>
>>>we should start a discussion on general@db.apache.org
>>>
>>>a general generator would be great!
>>>separating the torque generator is just a first step
>>>
>>>
>
>How about this?
>
>http://jakarta.apache.org/commons/sandbox/sql/index.html
>
>
commons-sql is based on the torque generator
there are also generators in ojb .. and there are generators outside
apache too
what we need:
general
- generate sql for a specific db
- setup a database
- insert data to the db
- generate docs
torque
- generate the om/peer classes
ojb
- generate an om + repository files
turbine
- generate vm templates + java code, so a prototype can be generated
based on the dbmodel
swing
- generate a prototype (something like the autoform function in m$ access)
i'll start a wiki page ... so people can add what they want the
generator to do ..
martin
Re: separate torque generator
Posted by James Strachan <ja...@yahoo.co.uk>.
From: "Neeme Praks" <ne...@apache.org>
> ok, moving this to general@db.apache.org.
>
> No code yet, but once Torque generator has been decoupled, then it
> should be quite easy to implement what I have in mind.
> And as I'm more familiar with Torque codebase (I have some 5-6 EJB
> applications in production with a patched version of Torque) it should
> be quite straightforward.
>
> I'm especially interested in writing some migration tools for:
> torque -> ojb/pb
> torque -> hibernate
> torque -> CMP entity beans 2.x
> + lower priority:
> torque -> ojb/jdo
> torque -> ojb/odmg
>
> Why am I migrating away? Well, the static way of handling things (like
> Torque does currently) is causing me headaches in EJB world... And I
> have learned to prefer to keep my persistent bean classes as lightweight
> as possible...
>
> As I really need this for my day job, I'm very much willing to write
> some implementation real soon.
>
> Rgds,
> Neeme
>
> Martin Poeschl ::
> > we should start a discussion on general@db.apache.org
> >
> > a general generator would be great!
> > separating the torque generator is just a first step
How about this?
http://jakarta.apache.org/commons/sandbox/sql/index.html
James
-------
http://radio.weblogs.com/0112098/
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
Re: separate torque generator
Posted by James Strachan <ja...@yahoo.co.uk>.
From: "Neeme Praks" <ne...@apache.org>
> ok, moving this to general@db.apache.org.
>
> No code yet, but once Torque generator has been decoupled, then it
> should be quite easy to implement what I have in mind.
> And as I'm more familiar with Torque codebase (I have some 5-6 EJB
> applications in production with a patched version of Torque) it should
> be quite straightforward.
>
> I'm especially interested in writing some migration tools for:
> torque -> ojb/pb
> torque -> hibernate
> torque -> CMP entity beans 2.x
> + lower priority:
> torque -> ojb/jdo
> torque -> ojb/odmg
>
> Why am I migrating away? Well, the static way of handling things (like
> Torque does currently) is causing me headaches in EJB world... And I
> have learned to prefer to keep my persistent bean classes as lightweight
> as possible...
>
> As I really need this for my day job, I'm very much willing to write
> some implementation real soon.
>
> Rgds,
> Neeme
>
> Martin Poeschl ::
> > we should start a discussion on general@db.apache.org
> >
> > a general generator would be great!
> > separating the torque generator is just a first step
How about this?
http://jakarta.apache.org/commons/sandbox/sql/index.html
James
-------
http://radio.weblogs.com/0112098/
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
Re: separate torque generator
Posted by Neeme Praks <ne...@apache.org>.
ok, moving this to general@db.apache.org.
No code yet, but once Torque generator has been decoupled, then it
should be quite easy to implement what I have in mind.
And as I'm more familiar with Torque codebase (I have some 5-6 EJB
applications in production with a patched version of Torque) it should
be quite straightforward.
I'm especially interested in writing some migration tools for:
torque -> ojb/pb
torque -> hibernate
torque -> CMP entity beans 2.x
+ lower priority:
torque -> ojb/jdo
torque -> ojb/odmg
Why am I migrating away? Well, the static way of handling things (like
Torque does currently) is causing me headaches in EJB world... And I
have learned to prefer to keep my persistent bean classes as lightweight
as possible...
As I really need this for my day job, I'm very much willing to write
some implementation real soon.
Rgds,
Neeme
Martin Poeschl ::
> we should start a discussion on general@db.apache.org
>
> a general generator would be great!
> separating the torque generator is just a first step
>
> do you have some code to share??
>
> martin
>
> Neeme Praks wrote:
>
>>
>> I'm currently thinking about implementing some more general
>> generator... See my email to commons-dev below. Would this fit inside
>> this decoupled generator better?
>>
>> -- Algne kiri -- Original Message --
>> Teema: [sql] DAO pattern?
>> Kuupäev: Fri, 07 Feb 2003 01:51:29 +0200
>> Kellelt: Neeme Praks <ne...@apache.org>
>> Vastusesaaja: Jakarta Commons Developers List
>> <co...@jakarta.apache.org>
>> Adressaat: commons-dev@jakarta.apache.org
>>
>> http://java.sun.com/blueprints/patterns/DAO.html
>>
>> I would be interested in implementing the DAO pattern for commons-sql:
>> * based on database schema, generate:
>> * bean interfaces
>> * simple bean implementations (private fields, getters and setters)
>> * optionally also abstract classes for entity beans (v2)
>> * based on some query descriptor, generate:
>> * factory interfaces
>> * factory implementations: OJB,Torque,hibernate,entity beans v2...
>>
>> This would allow people to use more-or-less pluggable persistence APIs.
>> I'm currently considering converting by applications from Torque to OJB,
>> so I'm probably going to implement this anyway...
>>
>> Would this be in the scope of the commons SQL project?
>> As this is kind of persistence abstraction (e.g. commons-logging), then
>> I guess it seems to be a fit for commons, no?
>>
>> Any pointers are helpful, as there seems to be zero docs available
>> currently (only docs I could find were copy-paste from torque). I saw
>> that there are a bunch of jelly scripts for DDL generation, but how do
>> they actually integrate with the rest of the stuff and how do I invoke
>> them...?
>>
>> Rgds,
>> Neeme
>>
>>
>> Martin Poeschl ::
>>
>>> i want to separate torque's generator from the runtime environment
>>>
>>> here's the plan:
>>>
>>> o move all generator stuff to /src/generator
>>> (incl. dtd, templates, maven-plugin, ...)
>>>
>>> o maven build for the generator
>>>
>>> o adopt the runtime tests to use the torque-gen.jar
>>>
>>> o move the generator related xdocs to src/generator/xdocs
>>>
>>>
>>> maybe we can use the generator as basis for a more general generator
>>> we could also switch to use commons-sql for the sql-generation
>>>
>>> i'll add a PRE_GENERATOR tag to the repo before i'll checkin the changes
>>>
>>> martin
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
>>> For additional commands, e-mail: torque-dev-help@db.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: torque-dev-help@db.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
>
Re: separate torque generator
Posted by Neeme Praks <ne...@apache.org>.
ok, moving this to general@db.apache.org.
No code yet, but once Torque generator has been decoupled, then it
should be quite easy to implement what I have in mind.
And as I'm more familiar with Torque codebase (I have some 5-6 EJB
applications in production with a patched version of Torque) it should
be quite straightforward.
I'm especially interested in writing some migration tools for:
torque -> ojb/pb
torque -> hibernate
torque -> CMP entity beans 2.x
+ lower priority:
torque -> ojb/jdo
torque -> ojb/odmg
Why am I migrating away? Well, the static way of handling things (like
Torque does currently) is causing me headaches in EJB world... And I
have learned to prefer to keep my persistent bean classes as lightweight
as possible...
As I really need this for my day job, I'm very much willing to write
some implementation real soon.
Rgds,
Neeme
Martin Poeschl ::
> we should start a discussion on general@db.apache.org
>
> a general generator would be great!
> separating the torque generator is just a first step
>
> do you have some code to share??
>
> martin
>
> Neeme Praks wrote:
>
>>
>> I'm currently thinking about implementing some more general
>> generator... See my email to commons-dev below. Would this fit inside
>> this decoupled generator better?
>>
>> -- Algne kiri -- Original Message --
>> Teema: [sql] DAO pattern?
>> Kuupäev: Fri, 07 Feb 2003 01:51:29 +0200
>> Kellelt: Neeme Praks <ne...@apache.org>
>> Vastusesaaja: Jakarta Commons Developers List
>> <co...@jakarta.apache.org>
>> Adressaat: commons-dev@jakarta.apache.org
>>
>> http://java.sun.com/blueprints/patterns/DAO.html
>>
>> I would be interested in implementing the DAO pattern for commons-sql:
>> * based on database schema, generate:
>> * bean interfaces
>> * simple bean implementations (private fields, getters and setters)
>> * optionally also abstract classes for entity beans (v2)
>> * based on some query descriptor, generate:
>> * factory interfaces
>> * factory implementations: OJB,Torque,hibernate,entity beans v2...
>>
>> This would allow people to use more-or-less pluggable persistence APIs.
>> I'm currently considering converting by applications from Torque to OJB,
>> so I'm probably going to implement this anyway...
>>
>> Would this be in the scope of the commons SQL project?
>> As this is kind of persistence abstraction (e.g. commons-logging), then
>> I guess it seems to be a fit for commons, no?
>>
>> Any pointers are helpful, as there seems to be zero docs available
>> currently (only docs I could find were copy-paste from torque). I saw
>> that there are a bunch of jelly scripts for DDL generation, but how do
>> they actually integrate with the rest of the stuff and how do I invoke
>> them...?
>>
>> Rgds,
>> Neeme
>>
>>
>> Martin Poeschl ::
>>
>>> i want to separate torque's generator from the runtime environment
>>>
>>> here's the plan:
>>>
>>> o move all generator stuff to /src/generator
>>> (incl. dtd, templates, maven-plugin, ...)
>>>
>>> o maven build for the generator
>>>
>>> o adopt the runtime tests to use the torque-gen.jar
>>>
>>> o move the generator related xdocs to src/generator/xdocs
>>>
>>>
>>> maybe we can use the generator as basis for a more general generator
>>> we could also switch to use commons-sql for the sql-generation
>>>
>>> i'll add a PRE_GENERATOR tag to the repo before i'll checkin the changes
>>>
>>> martin
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
>>> For additional commands, e-mail: torque-dev-help@db.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: torque-dev-help@db.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
>
Re: separate torque generator
Posted by Martin Poeschl <mp...@marmot.at>.
we should start a discussion on general@db.apache.org
a general generator would be great!
separating the torque generator is just a first step
do you have some code to share??
martin
Neeme Praks wrote:
>
> I'm currently thinking about implementing some more general
> generator... See my email to commons-dev below. Would this fit inside
> this decoupled generator better?
>
> -- Algne kiri -- Original Message --
> Teema: [sql] DAO pattern?
> Kuupäev: Fri, 07 Feb 2003 01:51:29 +0200
> Kellelt: Neeme Praks <ne...@apache.org>
> Vastusesaaja: Jakarta Commons Developers List
> <co...@jakarta.apache.org>
> Adressaat: commons-dev@jakarta.apache.org
>
> http://java.sun.com/blueprints/patterns/DAO.html
>
> I would be interested in implementing the DAO pattern for commons-sql:
> * based on database schema, generate:
> * bean interfaces
> * simple bean implementations (private fields, getters and setters)
> * optionally also abstract classes for entity beans (v2)
> * based on some query descriptor, generate:
> * factory interfaces
> * factory implementations: OJB,Torque,hibernate,entity beans v2...
>
> This would allow people to use more-or-less pluggable persistence APIs.
> I'm currently considering converting by applications from Torque to OJB,
> so I'm probably going to implement this anyway...
>
> Would this be in the scope of the commons SQL project?
> As this is kind of persistence abstraction (e.g. commons-logging), then
> I guess it seems to be a fit for commons, no?
>
> Any pointers are helpful, as there seems to be zero docs available
> currently (only docs I could find were copy-paste from torque). I saw
> that there are a bunch of jelly scripts for DDL generation, but how do
> they actually integrate with the rest of the stuff and how do I invoke
> them...?
>
> Rgds,
> Neeme
>
>
> Martin Poeschl ::
>
>> i want to separate torque's generator from the runtime environment
>>
>> here's the plan:
>>
>> o move all generator stuff to /src/generator
>> (incl. dtd, templates, maven-plugin, ...)
>>
>> o maven build for the generator
>>
>> o adopt the runtime tests to use the torque-gen.jar
>>
>> o move the generator related xdocs to src/generator/xdocs
>>
>>
>> maybe we can use the generator as basis for a more general generator
>> we could also switch to use commons-sql for the sql-generation
>>
>> i'll add a PRE_GENERATOR tag to the repo before i'll checkin the changes
>>
>> martin
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: torque-dev-help@db.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
Re: separate torque generator
Posted by Neeme Praks <ne...@apache.org>.
I'm currently thinking about implementing some more general generator...
See my email to commons-dev below. Would this fit inside this decoupled
generator better?
-- Algne kiri -- Original Message --
Teema: [sql] DAO pattern?
Kuupäev: Fri, 07 Feb 2003 01:51:29 +0200
Kellelt: Neeme Praks <ne...@apache.org>
Vastusesaaja: Jakarta Commons Developers List
<co...@jakarta.apache.org>
Adressaat: commons-dev@jakarta.apache.org
http://java.sun.com/blueprints/patterns/DAO.html
I would be interested in implementing the DAO pattern for commons-sql:
* based on database schema, generate:
* bean interfaces
* simple bean implementations (private fields, getters and setters)
* optionally also abstract classes for entity beans (v2)
* based on some query descriptor, generate:
* factory interfaces
* factory implementations: OJB,Torque,hibernate,entity beans v2...
This would allow people to use more-or-less pluggable persistence APIs.
I'm currently considering converting by applications from Torque to OJB,
so I'm probably going to implement this anyway...
Would this be in the scope of the commons SQL project?
As this is kind of persistence abstraction (e.g. commons-logging), then
I guess it seems to be a fit for commons, no?
Any pointers are helpful, as there seems to be zero docs available
currently (only docs I could find were copy-paste from torque). I saw
that there are a bunch of jelly scripts for DDL generation, but how do
they actually integrate with the rest of the stuff and how do I invoke
them...?
Rgds,
Neeme
Martin Poeschl ::
> i want to separate torque's generator from the runtime environment
>
> here's the plan:
>
> o move all generator stuff to /src/generator
> (incl. dtd, templates, maven-plugin, ...)
>
> o maven build for the generator
>
> o adopt the runtime tests to use the torque-gen.jar
>
> o move the generator related xdocs to src/generator/xdocs
>
>
> maybe we can use the generator as basis for a more general generator
> we could also switch to use commons-sql for the sql-generation
>
> i'll add a PRE_GENERATOR tag to the repo before i'll checkin the changes
>
> martin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>
>
Re: separate torque generator
Posted by "Peter S. Hamlen" <ph...@mail.com>.
As an observer only, I think this is a great idea. I've been
experimenting with building "add-ins" to the Torque generation
facility. (For example, we use Torque with Struts and so I'm working on
making Torque generate "form objects" for each table (so that we
separate out the web layer from the business object layer.)) It would be
easier to organize if the generator were in a separate directory.
-Peter
On Mon, 2003-02-10 at 06:13, Martin Poeschl wrote:
> i want to separate torque's generator from the runtime environment
>
> here's the plan:
>
> o move all generator stuff to /src/generator
> (incl. dtd, templates, maven-plugin, ...)
>
> o maven build for the generator
>
> o adopt the runtime tests to use the torque-gen.jar
>
> o move the generator related xdocs to src/generator/xdocs
>
>
> maybe we can use the generator as basis for a more general generator
> we could also switch to use commons-sql for the sql-generation
>
> i'll add a PRE_GENERATOR tag to the repo before i'll checkin the changes
>
> martin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>