You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Bogdan Vatkov <bv...@globaltech-bg.com> on 2004/02/19 18:23:37 UTC

torque, torque-gui(devaki) creators

Hi All,

First of all, just to mention:
I think devaki is pretty good, I use it since 12. Dec 2003 and 
except the annoyng single buffer drawings (i see flickering) and some little bugs it does all the things that it is supposed to do.

I have some suggestions about some improvements: (some fore-thoughts first)

I have extended the torque-generator process to cover all my tables with a corresponding 
JSPs and JavaBeans used in the JSPs that represent view (html tables) pages for browsing a 
db table and edit a single record also. 
and things like autogeneration of javascript menu for accessing the different pages
(torque-gen extensions are some velocity templates and a little control.vm modifications to have my templates processed)
I have added "weblication" target  in the build-torque.xml to do execute all these templates.

the final result is someting like phpMyAdmin or phpPgAdmin interfaces but much better: it brings more user oriented representation of data
for example on a row click in my (html)tables i have direct link (action) for the current row to list all its child rows from another table (relations)
or to create a new child and associate it to the just clicked row ...

i discontinue this description but the main point here is that 
based on torque (of course with some velocity templates packages) we could generate a lot and lot of usefull 
auto-generated java code (or even any text..any output languages ..you know it depends on the template itself)
which is based on a particular db-model (shema)

Questions to torque (gen) creators and devaki creator (Emmanuel):

How do you think? Is going to be a good direction to:
1) specify a standard way for including additional functionality (productionality)
in the torque-generator (at least some manual for extending the templates)

3) extend (or make extendable) the org.apache.torque.model to support the xml parsing and objectizing of user defined objects/attributes
for example in my case i might define inside the xml model some attributes for my columns like (include the column in the html table or not; for now i think i can realize this only by using the column's description attribute to define extra functionality)

2) extend devaki to be able to include custom defined attributes inside the column/table tags

With best regards,
Bogdan


Re: save/update problem

Posted by Rob Gordon <rg...@mwt.net>.
You know, it is really amazing how just asking the question can often
lead to an answer. It turns out I did not have any key defined for
the table I was trying to update.  Therefore, no selection
criterion were added to the 'selectCriteria' object  way down
in BaseMyObjPeer.doUpdate.

When I added a key to the table and generated new OM classes,
lo and behold, a new line showed up in BaseMyObjPeer that looked
like this:

selectCriteria.put(BIB_NUMBER, criteria.remove(BIB_NUMBER));

thereby providing a non-null keySet() further down in BasePeer.doUpdate.

Isn't life strange?

Rob

ps. I would not be surprised if some of those other save/update problems
people have been posting for the last few years were also caused by not
definng a key for a table.


Rob Gordon wrote:

> I am trying to do an update (ie, a save) on a Torque OM object.
> I fetched the object in a previous select, change two fields
> and now want to update the underlying record. Per everything
> I read all I have to do is call save. Nothing is happening.
>
> I am using 3.1.
>
> I have noticed many questions on the archive on problems
> involving update, but not many good answers. So, I offer
> another question.
>
> When I get way down in:
>
> BaseMyObjPeer.doUpdate(criteria, con)
>
> there is a call made to construct a new Criteria object, the
> selectCriteria,  which--without futher manipulation--passed to
>
> BasePeer.doUpdate(selectCriteria, criteria, con)
>
> Within BasePeer, a  keySet() of the selectCriteria's hash entries
> is requested BUT this in null--nothing was every done to selectCriteria
> except construct. It makes perfect sense that it is null, however, being
> so all the meaningful code within BasePeer.doUpdate() is skipped
> and the update never takes place. The updated record is not written
> to database.
>
> What the heck is going on? How does this ever work if nothing
> is ever added to the selectCriteria object so that requesting
> a keySet does not return null?
>
> Rob
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


save/update problem

Posted by Rob Gordon <rg...@mwt.net>.
I am trying to do an update (ie, a save) on a Torque OM object.
I fetched the object in a previous select, change two fields
and now want to update the underlying record. Per everything
I read all I have to do is call save. Nothing is happening.

I am using 3.1.

I have noticed many questions on the archive on problems
involving update, but not many good answers. So, I offer
another question.

When I get way down in:

BaseMyObjPeer.doUpdate(criteria, con)

there is a call made to construct a new Criteria object, the
selectCriteria,  which--without futher manipulation--passed to

BasePeer.doUpdate(selectCriteria, criteria, con)

Within BasePeer, a  keySet() of the selectCriteria's hash entries
is requested BUT this in null--nothing was every done to selectCriteria
except construct. It makes perfect sense that it is null, however, being
so all the meaningful code within BasePeer.doUpdate() is skipped
and the update never takes place. The updated record is not written
to database.

What the heck is going on? How does this ever work if nothing
is ever added to the selectCriteria object so that requesting
a keySet does not return null?

Rob


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: torque, torque-gui(devaki) creators

Posted by Emmanuel Florent <ef...@devaki.org>.
Is it the right list (at least at that time!, lol) ? 
got too much respect for ASF, i'd like to answer but I won't, will I ?

1) nextobjects-devel@lists.sourceforge.net (noisy from CVS)
2) nextobjects-user@lists.sourceforge.net (slow traffic)

Would you like to post again ?
I also would like to encourage anybody to join that project. 
(this is the right list, lol :) )

EF

On Thu, 2004-02
19 at 18:23, Bogdan Vatkov wrote:
> Hi All,
> 
> First of all, just to mention:
> I think devaki is pretty good, I use it since 12. Dec 2003 and 
> except the annoyng single buffer drawings (i see flickering) and some little bugs it does all the things that it is supposed to do.
> 
> I have some suggestions about some improvements: (some fore-thoughts first)
> 
> I have extended the torque-generator process to cover all my tables with a corresponding 
> JSPs and JavaBeans used in the JSPs that represent view (html tables) pages for browsing a 
> db table and edit a single record also. 
> and things like autogeneration of javascript menu for accessing the different pages
> (torque-gen extensions are some velocity templates and a little control.vm modifications to have my templates processed)
> I have added "weblication" target  in the build-torque.xml to do execute all these templates.
> 
> the final result is someting like phpMyAdmin or phpPgAdmin interfaces but much better: it brings more user oriented representation of data
> for example on a row click in my (html)tables i have direct link (action) for the current row to list all its child rows from another table (relations)
> or to create a new child and associate it to the just clicked row ...
> 
> i discontinue this description but the main point here is that 
> based on torque (of course with some velocity templates packages) we could generate a lot and lot of usefull 
> auto-generated java code (or even any text..any output languages ..you know it depends on the template itself)
> which is based on a particular db-model (shema)
> 
> Questions to torque (gen) creators and devaki creator (Emmanuel):
> 
> How do you think? Is going to be a good direction to:
> 1) specify a standard way for including additional functionality (productionality)
> in the torque-generator (at least some manual for extending the templates)
> 
> 3) extend (or make extendable) the org.apache.torque.model to support the xml parsing and objectizing of user defined objects/attributes
> for example in my case i might define inside the xml model some attributes for my columns like (include the column in the html table or not; for now i think i can realize this only by using the column's description attribute to define extra functionality)
> 
> 2) extend devaki to be able to include custom defined attributes inside the column/table tags
> 
> With best regards,
> Bogdan
>