Hi,
If I am using the same String in a few annotations, are my better off defining that String as a static constant.
For example, suppose I use:
@OrderBy("primaryKey ASC")
in several places, should I do:
final static String PRIMARY_KEY_ASC = "primaryKey ASC".
and then
@OrderBy(PRIMARY_KEY_ASC)
My guess is that there is no memory saving here as in the former approach hibernate will treat the String as a literal. However, I may prevent some silly start up errors.
The examples use the former approach, so I fear I may be being pedantic here.
Any thoughs?
|