Tuesday, 15 September 2015

java - @Temporal(TemporalType.TIMESTAMP) -



java - @Temporal(TemporalType.TIMESTAMP) -

is there similar mongodb? @temporal(temporaltype.timestamp)

@notnull @temporal(temporaltype.timestamp) @datetimeformat(style = "m-") private date lastupdatedate;

i trying create field automatically update "lastupdatedate" whenever the document updated.

or

in spring roo

field date --fieldname lastupdatedate --type java.util.date --notnull --persistencetype jpa_timestamp

looking around i'm surprised see there's not generic solution kind of thing. @codechimp said, shouldn't hard provide kind of thing out of box.

one possible solution creating annotation tag models , using aop, that'd take little work. this article shows naive approach doing that. copied code a gist give quick look, , seems modified you're looking do.

i'll seek circle weekend , set actual example, may want take see if you're comfortable kind of solution , interested.

java mongodb spring-roo

No comments:

Post a Comment