db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject Re: getDate()
Date Fri, 12 Aug 2005 15:56:01 GMT




I do not see any possibility that the object could handle a database
function on construction. The object would have to ask the database to
execute the function, and this process is different on different databases.
On Oracle, for example, one would have to do something like (Select
getDate() from dual), and this would certainly not work on any other
database.

The only possibility I see at the moment is to refresh the object from the
db and then get the inserted value.

     Thomas

Trey Long <james_long@provima.com> schrieb am 12.08.2005 17:39:13:

> On insertion that sounds reasonable. But how would the object handle it
> on construction? Especially if I decided to try to use the data in the
> object before inserting it. I don't have as much experience using Torque
> as I would like but I can certainly see a lot of little holes that would
> have to be stepped over. :)
>
> Thomas Fischer wrote:
>
> >
> >
> >Well, sure, the idea is not to support the function in java, but maybe
one
> >could support the function in the database. So if you would insert a new
> >object with a default value "getDate()" of the column some_date, and
would
> >set some_date in the java object to null and save the object, maybe the
> >database could use the default value for the some_date column upon
insert.
> >Not sure whether this can be done, though.
> >
> >    Thomas
> >
> >Trey Long <james_long@provima.com> schrieb am 12.08.2005 15:40:16:
> >
> >
> >
> >> From my limited view it seems that it would be pretty difficult to
> >>support some if not all DB functions as the database would support
them.
> >>It would at least take a trip to the database which would be...
> >>
> >>
> >cumbersome.
> >
> >
> >>Thomas Fischer wrote:
> >>
> >>
> >>
> >>>You are right, default values with sql functions in them are not
> >>>
> >>>
> >supported
> >
> >
> >>>by Torque. This is known, there is also an issue in scarab for this.
> >>>I should look into it some time whether this can be fixed.
> >>>
> >>>      Thomas
> >>>
> >>>Trey Long <james_long@provima.com> schrieb am 11.08.2005 15:12:59:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>I am using the following:
> >>>>
> >>>>Torque Version: 3.2-rc1
> >>>>Using: ANT, MSSQL
> >>>>
> >>>>I was able to get around the problem but I believe I now know what
the
> >>>>issue was. Inside of the generated schema it was calling a function
> >>>>'getDate()' that really didn't exist anywhere. That's because I used
> >>>>
> >>>>
> >the
> >
> >
> >>>>default value of (getDate()) in the MSSQL table schema. So I imagine
> >>>>that functions don't carry over so well as defaults in table schema
> >>>>while using torque.
> >>>>
> >>>>Thomas Fischer wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>Hi,
> >>>>>
> >>>>>to help you with this, some more information would be needed
> >>>>>- the part of the schema which caused the problem
> >>>>>- the version of Torque you are using
> >>>>>- a relevant snippet of generated code around
> >>>>>
> >>>>>
> >BaseQuestionnaire.java:45
> >
> >
> >>>>>where the comile error occurs.
> >>>>>
> >>>>>   Thomas
> >>>>>
> >>>>>Trey Long <james_long@provima.com> schrieb am 08.08.2005 18:11:20:
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>I am trying to compile the Torque generated classes and I am
running
> >>>>>>into a problem with a getDate() method. The following error is
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>returned:
> >>>
> >>>
> >>>
> >>>
> >>>>>>build:
> >>>>>>  [javac] Compiling 51 source files to C:\...\web\WEB-INF\classes
> >>>>>>  [javac] C:\...\BaseQuestionnaire.java:45: cannot find symbol
> >>>>>>  [javac] symbol  : method getdate()
> >>>>>>  [javac] location: class com.provima.pcsw.mssql.BaseQuestionnaire
> >>>>>>  [javac]     private Date created = new Date(getdate());
> >>>>>>  [javac]                                     ^
> >>>>>>  [javac] Note: Some input files use unchecked or unsafe
operations.
> >>>>>>  [javac] Note: Recompile with -Xlint:unchecked for details.
> >>>>>>  [javac] 1 error
> >>>>>>
> >>>>>>Any quick advice would be nice. I don't understand the purpose
of
> >>>>>>
> >>>>>>
> >this
> >
> >
> >>>>>>method or how to regen the classes in another way where this
error
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>won't
> >>>
> >>>
> >>>
> >>>
> >>>>>>crop up. I am loathe to edit it out of the class because I don't
know
> >>>>>>the implications and I don't want to have to edit it every time
the
> >>>>>>Object Model is built.
> >>>>>>
> >>>>>>Thanks, -Trey
> >>>>>>
>
>>>>>>---------------------------------------------------------------------
> >>>>>>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
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>---------------------------------------------------------------------
> >>>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
> >
> >
> >


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


Mime
View raw message