Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Entity field setting

Use field access (annotate fields instead of methods), make the fields
private, and only access them from the outside using getters/setters.
If you need to do something after the entity has been loaded by
EclipseLink, create a zero-parameter method and annotate it with
@PostLoad.

On Thu, May 21, 2009 at 6:29 PM, khaskett <khaskett@xxxxxxxxxxx> wrote:
>
> I have some code that changes an entity's field value based on changes in a
> different field value.  Is there a way to know when that data is being set
> when it first comes from the db vs when the application code has changed it?
> The problem that I am trying to handle is that when it is first pulled from
> the db it looks like every field has changed value, and it keeps setting the
> indicator field to changed, even though nothing has changed yet.  The
> indicator field is persisted too but I don't think there is a way to control
> which order fields get set, if I could I could just have the inidicator
> field get set last.
>
> Any thoughts on this?
> --
> View this message in context: http://www.nabble.com/Entity-field-setting-tp23656291p23656291.html
> Sent from the EclipseLink - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>


Back to the top