Reputation: 31
I have this code in my Entity class
@Table (schema= "xyz")
now I wish to read this xyz from some properties file. How can I do that?
something like this
@Table(schema= ${property.schema})
Upvotes: 1
Views: 418
Reputation: 595
You can't do that. A java annotation is simply metadata added to the source code. Once the vm runs this information can be used or discarded depending on the retention policy of the annotation. The attribute you are trying to configure must be a constant. For more info check this link.
Upvotes: 1