Class TableModule
- java.lang.Object
-
- com.github.collinalpert.java2db.modules.TableModule
-
public class TableModule extends Object
A helper module for getting information about database tables and their columns.- Author:
- Collin Alpert
-
-
Method Summary
Modifier and Type Method Description StringgetColumnName(Field field)Gets the corresponding table column name of a field.static TableModulegetInstance()StringgetTableName(Class<?> type)Gets the database table name from theTableNameattribute on the class.
-
-
-
Method Detail
-
getInstance
public static TableModule getInstance()
-
getTableName
public String getTableName(Class<?> type)
Gets the database table name from theTableNameattribute on the class. If there is no attribute, the class name in lower case characters is returned.- Parameters:
type- The entity to get the table name of.- Returns:
- The table name.
-
-