Yeah, that does look strange. But I actually copied and pasted those 
directly out of a book (on Safari). The idea is that these are immutable 
to the user. But the Hibernate GeneratedTime of INSERT means Hibernate 
sets the value on insert of the record, and ALWAYS that it sets the 
value (to the default) on the insert and every update.

Or that's the theory. :-) (I don't work.)

But you make a good point. I should try changing those to see what happens.

Chas.

Viktor Klang wrote:
> But both are updatable false and insertable false?
> 
> I might be daft, but that doesn't look good to me...
> 
> Cheers
> Viktor
> 
> On Tue, Oct 21, 2008 at 5:06 AM, Charles F. Munat <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
> 
>     In my Lift app based on the JPA demo I tried this, which should work
>     beautifully according to everything I've been able to get my hands on:
> 
>     @Temporal(TemporalType.TIMESTAMP)
>     @Column{val name="CREATED_AT", val updatable = false,
>       val insertable = false}
>     
> @org.hibernate.annotations.Generated(org.hibernate.annotations.GenerationTime.INSERT)
>     var createdAt : Date = new Date()
> 
>     @Temporal(TemporalType.TIMESTAMP)
>     @Column{val name="UPDATED_AT", val updatable = false,
>       val insertable = false}
>     
> @org.hibernate.annotations.Generated(org.hibernate.annotations.GenerationTime.ALWAYS)
>       var updatedAt : Date = new Date()
> 
>     This should, if I'm right, set an immutable created_at timestamp and a
>     mutable updated_at timestamp upon insert, and update the updated_at
>     timestamp upon each update.
> 
>     What it actually does is leave both fields null. What a drag.
> 
>     Any ideas? Is this a Scala thing? Am I missing something really obvious,
>     as usual?
> 
>     Thanks,
> 
>     Chas.
> 
> 
> 
> 
> 
> -- 
> Viktor Klang
> Senior Systems Analyst
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to