Annotation Interface Column
Annotation for customizing field-to-column mapping.
By default, field names are converted to snake_case. Use this annotation to specify a custom column name or mark a field as transient.
Example:
@Entity
public class UserData {
private Long id;
@Column(name = "discord_user_id")
private Long userId;
@Column(ignore = true)
private transient String cachedValue; // Not persisted
}
-
Optional Element Summary
Optional Elements
-
Element Details
-
name
String nameCustom column name.If empty, the field name is converted to snake_case.
- Returns:
- the column name
- Default:
""
-
ignore
boolean ignoreWhether this field should be ignored during persistence.- Returns:
- true to ignore this field
- Default:
false
-