net.java.ao.schema
Class CachingTableNameConverter

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

public final class CachingTableNameConverter
extends Object
implements TableNameConverter

A table name converter that simply caches the converted table names.

This implementation uses a ConcurrentMap and is thread safe.

Since:
0.9

Constructor Summary
CachingTableNameConverter(TableNameConverter delegateTableNameConverter)
           
 
Method Summary
 String getName(Class<? extends RawEntity<?>> entityClass)
          Generates a table name to correspond with the specified class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingTableNameConverter

public CachingTableNameConverter(TableNameConverter delegateTableNameConverter)
Method Detail

getName

public String getName(Class<? extends RawEntity<?>> entityClass)
Description copied from interface: TableNameConverter
Generates a table name to correspond with the specified class. The algorithm used must check for the existance of the Table annotation and use the appropriate override when necessary. If this check is not made, ActiveObjects will continue to function normally, but any code assuming the proper imlementation of @Table will likely fail.

Specified by:
getName in interface TableNameConverter
Parameters:
entityClass - The entity type for which a corresponding field name must be generated.
Returns:
A database table name which corresponds to the given entity type.


Copyright © 2007-2012. All Rights Reserved.