|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface ColumnOverride
For queries against databases, indicates that a property in the pureQuery bean represents a particular column.
The column that is specified for a property in a @ColumnOverride
annotation overrides any other column that is specified for the same property. This overide applies to the columns that are specified by the standard pureQuery mapping, and to the columns that are specified by the @Column
annotation. This overide also applies to the columns that are specified in the pureQuery bean class for which the annotation is specified, and to the columns that are specified in the superclasses of the class. This annotation is intended to override a @Column
annotation that is provided for a property, but it indicates a property-to-column mapping whether a @Column
annotation is present.
The @ColumnOverride
annotation does not specifiy table names, and as a result, it removes any table
element value that was set by an overridden @Column
annotation.
If more than one @ColumnOverride
annotation is wanted for a single pureQuery bean class, the @ColumnOverrides
annotation must be used.
The following example illustrates how a property-to-column mapping can be specified by using @ColumnOverride
:
@ColumnOverride(propertyName = "departmentName", column = "DEPTNAME")
public class Department {
. . .
}
Modifier and Type | Required Element and Description |
---|---|
String |
column Specifies the label of the database column that the property represents. |
String |
propertyName Specifies the name of a property. |
public abstract String column
The label of a column is the value returned by ResultSetMetaData.getColumnLabel(int)
. It is the name of the column, unless the SQL statement specifies an alias for the column (for example, by using the "AS" clause), in which case it is the alias.
public abstract String propertyName
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |