aspose file tools
The moose likes Object Relational Mapping and the fly likes Setting Dynamic element values in an Annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "Setting Dynamic element values in an Annotation" Watch "Setting Dynamic element values in an Annotation" New topic
Author

Setting Dynamic element values in an Annotation

Ola Daniel
Ranch Hand

Joined: Jul 27, 2005
Posts: 105


Hi Guys,

I was wondering if it is possible supply values to an annotation dynamically. Say I want the default message in the above piece of code to come from an Database Entity POJO. Is it possible to do this? If yes, how. Just a nudge in the right direction.

is it possible to set these values in the Validation class' initialize method?

Thanks.

SCJP 1.4, SCWCD 1.4
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
- Martin Fowler et al, Refactoring: Improving the Design of Existing Code, 1999
Anantha Sharma
Ranch Hand

Joined: Sep 01, 2010
Posts: 43

i don't think it is possible... the values provided to any annotation is computed at compile time & not at runtime also the value provided must be constant, so its not possible to have the value come from a database..

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Setting Dynamic element values in an Annotation
 
Similar Threads
deployment descriptor value overrides the annotation value
JAX-WS HTTP Binding
Query rgd interceptor invocation order
Constraint Annotation
Webservice implementing Provider<Source>: no difference with service mode MESSAGE or PAYLOAD