You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Marcus Breese <ma...@breese.com> on 2003/06/10 17:28:26 UTC

Using Torque to generate repository.xml, etc...

I'm sorry if this has been covered before, a quick search yielded 
nothing, so I thought I'd just ask...

Is anyone out there using the build scripts included with torque to 
build the repository.xml file(s) and possibly associated classes?

I'm currently using them (somewhat modified) to build my object model 
classes and the repository, but I'm having some problems with getting 
it to build relationships (1:n, m:n, etc...).  I'm considering altering 
the Torque DTD to allow for explicit back-links (inverse 
relationships), but want to know if anyone else has already done this 
or is working on something similar.

Does anyone have any thoughts / suggestions?

-=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-=-
Marcus Breese                            mbreese@iupui.edu
IU School of Medicine              marcus@breese.com
Dept. of Biochemistry and Molecular Biology
Center for Medical Genomics / Grow Lab


Re: Using Torque to generate repository.xml, etc...

Posted by Marcus Breese <ma...@breese.com>.
Here's what we decided to do with our design problem.  I'm looking for 
any feedback.

We're going to generate a BaseObject class and create the database 
using the Torque build scripts using a custom project-schema.xml file.  
Additionally, we're going to alter the Velocity scripts to add in 
ojb-xdoclet tags to these classes.  We're going to have an extended 
class also created (never overwritten, just created if it doesn't 
exist).  This class is where we'll put out 1:n / n:m collections 
(manually).  These will have ojb-xdoclet tags as well... The final step 
is to then use the ojb-xdoclet parser to create the repository_user.xml 
file for OJB.

Does this sound like a viable solution?  Am I missing something?

Basically, our goal is to have as much generated from a config file as 
possible...  We'd like to not have to create each class that we know 
we're going to need...  This seemed like a good alternative to the pure 
ojb-doclet approach with required a decent amount of hand-coding...

Any suggestions would be greatly appreciated.

On Thursday, June 12, 2003, at 01:34  AM, Danilo Tommasina wrote:

> hi,
>
>> I've looked at using the OJB-XDoclet project to do the same type of
>> thing, but it seems to have some bugs as well.  Plus, I prefer to do 
>> my
>> modeling from the DB, and just extend those base classes.
>
> yep, we also have to work with reverse engineering, we are using 
> torque because it gives us much more control on the repository/code 
> generation.
> we also need to do some automated changes in the repository (after 
> generating it trough torque) before generating the object model.
> The reverse db tool doesn't give us the possibility to do that and to 
> integrate these steps in ant scripts.
>
>> As far as working with 1:n / n:m, I think that we're going to extend
>> the Torque DTD/schema and add a new possible data type "VECTOR".  Then
>> using the Velocity templates build specialized sections when using 
>> this
>> data type.  We've already added some base functionality through the
>> Velocity templates, but haven't tried this yet.
>>
>> Let me know if this approach sounds good to you...
>
> yep, i was also thinking to do something similar, however I still 
> hadn't the time to check it deeply (just writing some docu for the 
> project, boooooring)
> It is probably useful to get a look how the reversedb tool generates 
> the shema for 1:n/n:m relationships by looking in its source code 
> (yeah, I love Open Source)
> I'm probably going into this in the second half of next week, so if 
> you have some solutions, it would be great if you could post them. 
> Thanks
>
> bye
> danilo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
-=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-=-
Marcus Breese                            mbreese@iupui.edu
IU School of Medicine              marcus@breese.com
Dept. of Biochemistry and Molecular Biology
Center for Medical Genomics / Grow Lab



Re: Using Torque to generate repository.xml, etc...

Posted by Danilo Tommasina <dt...@risksys.com>.
hi,

> I've looked at using the OJB-XDoclet project to do the same type of
> thing, but it seems to have some bugs as well.  Plus, I prefer to do my
> modeling from the DB, and just extend those base classes.

yep, we also have to work with reverse engineering, we are using torque because it gives us much more control on the repository/code generation.
we also need to do some automated changes in the repository (after generating it trough torque) before generating the object model.
The reverse db tool doesn't give us the possibility to do that and to integrate these steps in ant scripts.

> As far as working with 1:n / n:m, I think that we're going to extend
> the Torque DTD/schema and add a new possible data type "VECTOR".  Then
> using the Velocity templates build specialized sections when using this
> data type.  We've already added some base functionality through the
> Velocity templates, but haven't tried this yet.
>
> Let me know if this approach sounds good to you...

yep, i was also thinking to do something similar, however I still hadn't the time to check it deeply (just writing some docu for the project, boooooring)
It is probably useful to get a look how the reversedb tool generates the shema for 1:n/n:m relationships by looking in its source code (yeah, I love Open Source)
I'm probably going into this in the second half of next week, so if you have some solutions, it would be great if you could post them. Thanks

bye
danilo

Re: Using Torque to generate repository.xml, etc...

Posted by Marcus Breese <ma...@breese.com>.
I've looked at using the OJB-XDoclet project to do the same type of 
thing, but it seems to have some bugs as well.  Plus, I prefer to do my 
modeling from the DB, and just extend those base classes.

As far as working with 1:n / n:m, I think that we're going to extend 
the Torque DTD/schema and add a new possible data type "VECTOR".  Then 
using the Velocity templates build specialized sections when using this 
data type.  We've already added some base functionality through the 
Velocity templates, but haven't tried this yet.

Let me know if this approach sounds good to you...


On Wednesday, June 11, 2003, at 02:00  AM, Danilo Tommasina wrote:

> Hi Marcus,
>
> yes, I'm doing the same, however I still not tested the 1:n / n:m 
> reletionships,
> I did some modifications of the ojb velocity templates to fix some 
> 'bugs' and to obtain a nice formatting an extra features automatically 
> put in my model.
> I actually don't know if the Torque DTD is supporting 1:n / n:m 
> relationships (still a newbie and still didn't looked at it), maybe 
> you have to modify the velocity templates for a complete code 
> generation
>
> let me know if you find out something about the torque DTD
> bye
> Danilo
>
>> I'm sorry if this has been covered before, a quick search yielded
>> nothing, so I thought I'd just ask...
>>
>> Is anyone out there using the build scripts included with torque to
>> build the repository.xml file(s) and possibly associated classes?
>>
>> I'm currently using them (somewhat modified) to build my object model
>> classes and the repository, but I'm having some problems with getting
>> it to build relationships (1:n, m:n, etc...).  I'm considering 
>> altering
>> the Torque DTD to allow for explicit back-links (inverse
>> relationships), but want to know if anyone else has already done this
>> or is working on something similar.
>>
>> Does anyone have any thoughts / suggestions?
>>
>> -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-=-
>> Marcus Breese                            mbreese@iupui.edu
>> IU School of Medicine              marcus@breese.com
>> Dept. of Biochemistry and Molecular Biology
>> Center for Medical Genomics / Grow Lab
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>
-=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-=-
Marcus Breese                            mbreese@iupui.edu
IU School of Medicine              marcus@breese.com
Dept. of Biochemistry and Molecular Biology
Center for Medical Genomics / Grow Lab



Re: Using Torque to generate repository.xml, etc...

Posted by Danilo Tommasina <dt...@risksys.com>.
Hi Marcus,

yes, I'm doing the same, however I still not tested the 1:n / n:m reletionships,
I did some modifications of the ojb velocity templates to fix some 'bugs' and to obtain a nice formatting an extra features automatically put in my model.
I actually don't know if the Torque DTD is supporting 1:n / n:m relationships (still a newbie and still didn't looked at it), maybe you have to modify the velocity templates for a complete code generation

let me know if you find out something about the torque DTD
bye
Danilo

> I'm sorry if this has been covered before, a quick search yielded
> nothing, so I thought I'd just ask...
>
> Is anyone out there using the build scripts included with torque to
> build the repository.xml file(s) and possibly associated classes?
>
> I'm currently using them (somewhat modified) to build my object model
> classes and the repository, but I'm having some problems with getting
> it to build relationships (1:n, m:n, etc...).  I'm considering altering
> the Torque DTD to allow for explicit back-links (inverse
> relationships), but want to know if anyone else has already done this
> or is working on something similar.
>
> Does anyone have any thoughts / suggestions?
>
> -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-=-
> Marcus Breese                            mbreese@iupui.edu
> IU School of Medicine              marcus@breese.com
> Dept. of Biochemistry and Molecular Biology
> Center for Medical Genomics / Grow Lab
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org