net.java.ao.schema
Class TableAnnotationTableNameConverter

java.lang.Object
  extended by net.java.ao.schema.TableAnnotationTableNameConverter
All Implemented Interfaces:
TableNameConverter

public final class TableAnnotationTableNameConverter
extends java.lang.Object
implements TableNameConverter

Gets the table name from the Table annotation. If no annotation is present on the given entity then it will delegate to the configured TableNameConverter.

Since:
0.9

Field Summary
static java.lang.Class<Table> TABLE_ANNOTATION
           
 
Constructor Summary
TableAnnotationTableNameConverter(TableNameConverter delegateTableNameConverter)
           
TableAnnotationTableNameConverter(TableNameConverter delegateTableNameConverter, CanonicalClassNameTableNameConverter postProcessingTableNameConverter)
           
 
Method Summary
 java.lang.String getName(java.lang.Class<? extends RawEntity<?>> entityClass)
          Gets the name of the table either from the Table annotation if present or from the delegate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TABLE_ANNOTATION

public static final java.lang.Class<Table> TABLE_ANNOTATION
Constructor Detail

TableAnnotationTableNameConverter

public TableAnnotationTableNameConverter(TableNameConverter delegateTableNameConverter)

TableAnnotationTableNameConverter

public TableAnnotationTableNameConverter(TableNameConverter delegateTableNameConverter,
                                         CanonicalClassNameTableNameConverter postProcessingTableNameConverter)
Method Detail

getName

public java.lang.String getName(java.lang.Class<? extends RawEntity<?>> entityClass)
Gets the name of the table either from the Table annotation if present or from the delegate.

Specified by:
getName in interface TableNameConverter
Parameters:
entityClass - the entity from which to extract the table name
Returns:
the table name for the given entity
Throws:
java.lang.IllegalStateException - if the Table annotation value is invalid (null or empty String)


Copyright © 2007-2012. All Rights Reserved.