Package io.ran
Annotation Interface DbName
@DbName
is used to specify the name of a table or column in the database.
This is especially useful when the name of the table or column is a reserved word in the database, or when the data model is being generated from an existing database.
Example:
@DbName("users")
public class User {
@DbName("user_id")
public Long id;
@DbName("user_name")
public String name;
}
This will use a table named "users" with columns "user_id" and "user_name", instead of "user" with columns "id" and "name".
When DbName is not specified a default pattern is used to convert the name of the field to the name of the column, and the name of the class to the name of the table. This works by converting all names to snake_case (from camelCase or PascalCase). The final pattern is controlled by the ORM implementation, so it may be different for different databases.
- See Also:
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
value
String valueThe name of the table or column in the database.- Returns:
- the name of the table or column in the database, alphanumerics and underscores only
-
-