|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=METHOD) public @interface SQLType
Explicitly specifies the underlying database field type for the corresponding field to the method in question. This should be used for use-cases where the default corresponding type for a particular Java return type is inappropriate for the situation. For example:
public interface Book extends Entity { public String getTitle(); public void setTitle(String title); @SQLType(Types.CLOB) public String getText(); @SQLType(Types.CLOB) public void setText(String text); }
This annotation can also be used to specify precision and scale for the underlying type. Thus, this annotation is a single-point, one-shot mechanism for controlling the type used for a specific field.
Optional Element Summary | |
---|---|
int |
precision
Specifies the precision of the SQL type in the underlying field. |
int |
scale
Specifies the scale of the SQL type in the underlying field. |
int |
value
Specifies the actual SQL type integer which will be used to represent the corresponding field in the database. |
public abstract int value
Types
constants
list. If unspecified, type will be whatever the default is
for a method of the return type in question.
public abstract int precision
public abstract int scale
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |