db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raphael Mankin <r...@mankin.org.uk>
Subject RE: Database generated default values.
Date Sun, 31 Oct 2004 14:10:08 GMT
A simple work-around is, of course, to do the initialisation in the constructor
for InterviewHeader. This has the benefit that you always know what timezone
the date is in (UTC), but the disadvantage that it does not happen if you
create a row outside your java app.


On 29-Oct-2004 Vidas Simkus wrote:
> Hi, guys
> 
> I've searched high and low for an answer to this one to no avail.  I'm 
> hoping that someone here will be able to help me out.
> 
> I'm trying to specify a default column value that would be provided by 
> the database.  In particular a value returned by Oracle's 'sysdate'.  If 
> I specify 'sysdate' as a value for the default attribute in the column 
> definition I get a compile error:
> 
> [javac] symbol  : variable sysdate
> [javac] location: class edu.uic.csr.webapps.TTP.opl.BaseInterviewHeader
> [javac]     private Date insertionDate = new Date(sysdate);
> 
> If I manually modify the table and set the default value to 'sysdate', 
> the Torque generated classes will try to set the column value to NULL.  
> This cause Oracle to spew an ugly error message about a 'not null' 
> constraint violation.
> 
> Any suggestions?
> 
> Thanks in advance.
> 
> Vic
> 
> -- 
> My favorite animal is steak.
> -Fran Lebowitz
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 

-- 
                               Lead us not into temptation; we
                               can find our own way.


Raphael Mankin
----------------------------------

---------------------------------------------------------------------
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