This way you work a lot to get the same results:
Code:
@Column(
name = "ID_BANK",
precision = 4
)
@Description("{bank.Id}")
@Max(
value = 9999,
message = "{annotations.max}"
)
@Min(
value = 1000,
message = "{annotations.min}"
)
private java.lang.Short bankId = null;
bank.Id=Bank Id
annotations.min=Min size of {value} has not been reached
annotations.min=Max size of {value} has not been reached
This way you have a
general message error for
every validation annotationCode:
annotations.min=Min size of {value} has not been reached
annotations.min=Max size of {value} has not been reached
and a
particular description of every field using @Description.
This annotation may be involved in:
1. Error message sent to final user.
2. Column name to be used in a Head from a Report.
3. Column name in a tool to compose querys.
To be more practical, Invalid bean returned to user should include description of every field involved in error (supposing it has been given). This way designer can decide its use to compose final error message or not.
Quote:
Plus, its more flexible since language doesn't no always set the property name at sentence head.
I do not know what you mean by this.