Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] How to retrieve a non database field and not having it persistent

This is not something JPA directly supports.  Some possibilities are:
- Map it as transient, and lazy initialize it from the database when first
- Map is using a @TransformationMapping
- If you can get it retrieved (are you calling the column name "SYSDATE"?),
then mark the @Column insertable=false, updatable=false to avoid writing it.
- Use a "new Date()" in Java instead.

SPHQ wrote:
> Using eclipselink and oracle - For example, I want to execute
> Select sysdate from dual and store the result in an attribute ( say X ) of
> a class
> and the attribute not being a field in the table.
> If I use @Transient , the value is not retrieved. 
> If I do not use @transient, the value is retrieved  but when I try to
> persist,
> it says 'unknow identifier'. Can somebody help ?

--- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top