Class TableModule


  • public class TableModule
    extends java.lang.Object
    A helper module for getting information about database tables and their columns.
    Author:
    Collin Alpert
    • Constructor Summary

      Constructors 
      Constructor Description
      TableModule()  
    • Method Summary

      Modifier and Type Method Description
      java.lang.String getColumnName​(java.lang.reflect.Field field)
      Gets the corresponding table column name of a field.
      java.lang.String getTableName​(java.lang.Class<?> type)
      Gets the database table name from the TableName attribute on the class.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TableModule

        public TableModule()
    • Method Detail

      • getTableName

        public java.lang.String getTableName​(java.lang.Class<?> type)
        Gets the database table name from the TableName attribute 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.
      • getColumnName

        public java.lang.String getColumnName​(java.lang.reflect.Field field)
        Gets the corresponding table column name of a field.
        Parameters:
        field - The field representing the column in a table.
        Returns:
        The column name in the table.