Bill, Thanks for the pointer. I guess the easiest would be write my own SQLManager class which would then be used in the Peer classes to run a custom query. I'll also look into the Criteria.CUSTOM option.
Would you have any ideas regarding the other 2 issues which I mentioned in my original mail? Thanks, Prashant At 08:49 AM 5/23/2002 -0400, you wrote: >Yes. You can always add extra methods to the generated objects/peers that >issue queries directly over JDBC; Torque.getConnection() should give you a >connection. There is also a "CUSTOM" criteria type that allows you to add a >custom WHERE clause fragment alongside with other criteria: > >crit.add(column, "value"); >crit.add(column2, "exists (select 1 from ... where ....)", Criteria.CUSTOM); > >(or maybe I have the syntax backwards?) >-- Bill >----- Original Message ----- >From: "Prashant Singhal" <[EMAIL PROTECTED]> >To: "Turbine Torque Developers List" <[EMAIL PROTECTED]> >Sent: Thursday, May 23, 2002 7:24 AM >Subject: Java attribute to column mapping & Directory Structure > > > > Hi, > > > > Sorry if this is out of place. > > But, I'm evaluating torque for our application (under development). I > > wanted to know a couple of things but didn't get any reply on the > > torque-user list. I'm hoping if somebody can answer my questions. I'm > > including the email i sent to torque-user. > > > > Moreover, I wanted to know if we can bypass the "criteria" object and use > > our own SQL directly? (say for advanced queries). > > > > -- Prashant > > > > > > At 06:13 PM 5/22/2002 +0530, you wrote: > > >Hi, > > > > > >I want to know if we can do the following... > > > > > >Create a column in the schema, say XYZ. > > >Now XYZ is stored in the DB as an INTEGER. But on the java side, I want >it > > >to be represented as an ENUM. Basicaly, when we access the column XYZ in > > >the java code, an ENUM is returned rather than an INTEGER. There might >not > > >be any difference between ENUM and INTEGER but as far as the application > > >is concerned, it is dealing with an ENUM. It shouldn't matter how it is > > >being stored in the DB. > > >In ObjectBridge, there is a way to map a column to any java type provided > > >that we provide a couple of methods, java2db() and db2java(). I was > > >wondering if there is a way to do this in Torque. I think, in the torque > > >schema, there is a "javatype" attribute for the columns. But, it can only > > >take values "object" or "primitive". > > > > > >Secondly, All the "om" classes are created in the same directory. > > >(whatever package name you provide). For instance, in the torque example > > >provided, all the classes for "Author", "Book", "Publisher" are created >in > > >the same directory (say ABC). Is there a way so that the directory > > >structure can be "ABC/Author", "ABC/Book", "ABC/Publisher". This will > > >result in a more maintainable O/R layer for the developers. If all the > > >classes are created in the same directory, it becomes unmanageable after > > >say 10-15 tables. (more so if you're using "managers"). > > > > > >Thanks, > > >Prashant > > > > > > > > >-- > > >To unsubscribe, > > >e-mail: <mailto:[EMAIL PROTECTED]> > > >For additional commands, e-mail: > > ><mailto:[EMAIL PROTECTED]> > > > > > > > > > -- > > To unsubscribe, e-mail: ><mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: ><mailto:[EMAIL PROTECTED]> > > > > >-- >To unsubscribe, >e-mail: <mailto:[EMAIL PROTECTED]> >For additional commands, e-mail: ><mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
